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/novafloss/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.

Warning

Python Compatibility : python2.7 (tox says it’s compliant up to python3.2, but I don’t) Django compatibility : django1.8

Licence

MIT Licence

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

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.

formidable-ui

Plug in formidable-ui

https://github.com/peopledoc/formidable-ui#integration

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-0.5.0.tar.gz (21.4 kB view details)

Uploaded Source

Built Distribution

django_formidable-0.5.0-py2-none-any.whl (33.9 kB view details)

Uploaded Python 2

File details

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

File metadata

File hashes

Hashes for django-formidable-0.5.0.tar.gz
Algorithm Hash digest
SHA256 d207a66f50fafa8640175e386c6a1466314d03295bdf8c3878c60efb728bfa71
MD5 39d90bc6189e2ff9bf52a9b9448bd1b6
BLAKE2b-256 84b2a8ce34f951a54551a7db9458e6919b6c9c17978ce140db518531e9fdd295

See more details on using hashes here.

Provenance

File details

Details for the file django_formidable-0.5.0-py2-none-any.whl.

File metadata

File hashes

Hashes for django_formidable-0.5.0-py2-none-any.whl
Algorithm Hash digest
SHA256 d31553b3ee0e7be962adbd3fd32e9cbca7abf7b5eff9eef58a040dc1ab358584
MD5 87738be26a1bc769ff612b7e64c520d2
BLAKE2b-256 64a9fb559df7365e1144c7cb6aa8bef491b2c7115d2d6f17847eba459ff6a536

See more details on using hashes here.

Provenance

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