Skip to main content

django-formidable is a full django application which allows you to create, edit, delete and use forms.

Project description

docs/source/_static/formidable-logo.png https://circleci.com/gh/peopledoc/django-formidable.svg?style=svg&circle-token=6f273f564e1e44f702aef7c1d00baff74609c791

django-formidable is a full django application which allows you to create, edit, delete and use forms.

Warnings

  • Python Compatibility : 3.6, 3.7, 3.8

  • Django compatibility : Django 2.2.

  • Django REST Framework : Compatible from the version 3.9.x to 3.11.x

See the Deprecation timeline document for more information on deprecated versions.

License

MIT License

Documentation

Latest version of the documentation: http://django-formidable.readthedocs.io/en/latest/

If you want to build the documentation locally, you can try to run one of the following:

$ make docs
$ tox -e docs

You can also browse the documentation locally, using the following, for example:

$ make docs serve-docs

About the model graph

On the “intro” page of the documentation, you can see a graph of the different Django models defined in the application.

To generate this graph, you’ll need to have graphviz installed on your system.

When you’re ready, you may initiate this generation using:

$ tox -e django_graph

Quick-Start

Install

$ pip install django-formidable

Configure

Define Roles

django-formidable allows access to a single form by different roles. The same form can thus be rendered in different ways. If you don’t need to handle multiple roles you must still define at least one default role.

Define a method which returns a list of formidable.accesses.AccessObject:

def get_roles(self):
    return [
        AccessObject(id='padawan', label='Padawan'),
        AccessObject(id='jedi', label='Jedi')
    ]

Fill the settings key:

FORMIDABLE_ACCESS_RIGHTS_LOADER = 'yourproject.access_rights.get_roles'

Get context

While accessing a form for a specific role, you need to provide a way in which to get the correct context to use.

request and kwargs are fetched from the view (self.request, self.kwargs)

def get_context(request, kwargs):
    return request.user.user_type

Next fill the setting key FORMIDABLE_CONTEXT_LOADER

FORMIDABLE_CONTEXT_LOADER = 'yourprojects.access_rights.get_context'

Define URLs

URLs are defined in formidable.urls. You can load them with the following line:

url(r'^api/', include('formidable.urls', namespace='formidable'))

By default, the views are not accessible, the permissions loaded are fully restrictive. To allow any access to the view fill your settings with

FORMIDABLE_DEFAULT_PERMISSION=['rest_framework.permissions.AllowAll']

To handle special permissions, please refer to the online documentation.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-formidable-7.2.0.tar.gz (33.1 kB view details)

Uploaded Source

Built Distribution

django_formidable-7.2.0-py3-none-any.whl (47.3 kB view details)

Uploaded Python 3

File details

Details for the file django-formidable-7.2.0.tar.gz.

File metadata

  • Download URL: django-formidable-7.2.0.tar.gz
  • Upload date:
  • Size: 33.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for django-formidable-7.2.0.tar.gz
Algorithm Hash digest
SHA256 e19a5975ecc2016f3293590f4a17f592516e7e5ca39f87eb1ade00ff4d6e297b
MD5 abcde497fdf24e6a01d50d87f082cefe
BLAKE2b-256 963d4494522a4297e07bd5a473c71ad8e399915fa7e6ad9948a61fa4312e18e6

See more details on using hashes here.

File details

Details for the file django_formidable-7.2.0-py3-none-any.whl.

File metadata

  • Download URL: django_formidable-7.2.0-py3-none-any.whl
  • Upload date:
  • Size: 47.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for django_formidable-7.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d658ac8623a7da55acf20ae27940cfd9b8b3b1b51b12f7fded32497db37f75ed
MD5 1bb5f9e9880f71771616000aab3a3725
BLAKE2b-256 c417d390c8bd30a6518f99a0691562a76693529ebdc853c1cdec2e6378d1afc1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page