django-fobi

django-fobi (or just fobi) is a customisable, modular, user- and developer- friendly form generator/builder application for Django. With fobi you can build Django forms using an intuitive GUI, save or mail posted form data or even export forms into JSON format and import them on other instances. API allows you to build your own form elements and form handlers (mechanisms for handling the submitted form data).

Prerequisites

Present

  • Django 1.8, 1.9, 1.10 and 1.11.
  • Python 2.7, 3.4, 3.5, 3.6 and PyPy.

Note, that Django 1.11 is not yet proclaimed to be flawlessly supported. The core and contrib packages have been tested against the Django 1.11. All tests have successfully passed, although it’s yet too early to claim that Django 1.11 is fully supported.

Past

  • Dropping support of Django 1.5, 1.6 has been announced in version 0.9.13. Dropping support of Django 1.7 has been announced in version 0.9.17. As of 0.9.17 everything is still backwards compatible with versions 1.5, 1.6 and 1.7, but in future versions compatibility with these versions will be wiped out.
  • Dropping support of Python 2.6 has been announced in version 0.9.17. As of 0.9.17 everything is still backwards compatible with Python 2.6, but in future versions compatibility with it will be wiped out.
  • Since version 0.10.4 support for Python 3.3 has been dropped.

Key concepts

  • Each form consists of elements. Form elements are divided into two groups:
    1. form fields (input field, textarea, hidden field, file field, etc.).
    2. content (presentational) elements (text, image, embed video, etc.).
  • Number of form elements is not limited.
  • Each form may contain handlers. Handler processes the form data (for example, saves it or mails it). Number of the handlers is not limited.
  • Both form elements and form handlers are made with Django permission system in mind.
  • As an addition to form handlers, form callbacks are implemented. Form callbacks are fired on various stages of pre- and post-processing the form data (on POST). Form callbacks do not make use of permission system (unless you intentionally do so in the code of your callback) and are fired for all forms (unlike form handlers, that are executed only if assigned).
  • Each plugin (form element or form handler) or a callback - is a Django micro-app.
  • In addition for form element and form handler plugins, integration form element and integration form handler plugins are implemented for integration with diverse third-party apps and frameworks (such as Django REST framework).

Note, that django-fobi does not require django-admin and administrative rights/permissions to access the UI, although almost seamless integration with django-admin is implemented through the simple theme.

Main features and highlights

  • User-friendly GUI to quickly build forms.
  • Large variety of Bundled form element plugins. Most of the Django fields are supported. HTML5 fields are supported as well.
  • Form wizards. Combine your forms into wizards. Form wizards may contain handlers. Handler processes the form wizard data (for example, saves it or mails it). Number of the form wizard handlers is not limited.
  • Anti-spam solutions like CAPTCHA, ReCAPTCHA or Honeypot come out of the box (CAPTCHA and ReCAPTCHA do require additional third-party apps to be installed).
  • In addition to standard form elements, there are cosmetic (presentational) form elements (for adding a piece of text, image or a embed video) alongside standard form elements.
  • Data handling in plugins (form handlers). Save the data, mail it to some address or re-post it to some other endpoint. See the Bundled form handler plugins for more information.
  • Developer-friendly API, which allows to edit existing or build new form fields and handlers without touching the core.
  • Support for custom user model.
  • Theming. There are 4 ready to use Bundled themes: “Bootstrap 3”, “Foundation 5”, “Simple” (with editing interface in style of Django admin) and “DjangoCMS admin style” theme (which is another simple theme with editing interface in style of djangocms-admin-style).
  • Implemented integration with Django REST framework.
  • Implemented integration with FeinCMS (in a form of a FeinCMS page widget).
  • Implemented integration with DjangoCMS (in a form of a DjangoCMS page plugin).
  • Implemented integration with Mezzanine (in a form of a Mezzanine page).
  • Reordering of form elements using drag-n-drop.
  • Data export (DB store form handler plugin) into XLS/CSV format.
  • Dynamic initial values for form elements.
  • Import/export forms to/from JSON format.
  • Import forms from MailChimp using mailchimp importer.

Roadmap

Some of the upcoming/in-development features/improvements are:

  • Wagtail integration (in version 0.12).
  • Bootstrap 4 and Foundation 6 support (in version 0.13).

See the TODOS for the full list of planned-, pending- in-development- or to-be-implemented features.

Some screenshots

See the documentation for some screen shots:

Demo

Live demo

See the live demo app on Heroku. Additionally, see the Django REST framework integration demo.

Credentials:

  • username: test_user
  • password: test_user

Run demo locally

In order to be able to quickly evaluate the django-fobi, a demo app (with a quick installer) has been created (works on Ubuntu/Debian, may work on other Linux systems as well, although not guaranteed). Follow the instructions below for having the demo running within a minute.

Grab the latest django_fobi_example_app_installer.sh:

wget https://raw.github.com/barseghyanartur/django-fobi/stable/examples/django_fobi_example_app_installer.sh

Assign execute rights to the installer and run the django_fobi_example_app_installer.sh:

chmod +x django_fobi_example_app_installer.sh
./django_fobi_example_app_installer.sh

Open your browser and test the app.

Dashboard:

Django admin interface:

If quick installer doesn’t work for you, see the manual steps on running the example project.

Quick start

See the quick start.

Installation

  1. Install latest stable version from PyPI:
pip install django-fobi

Or latest stable version from GitHub:

pip install https://github.com/barseghyanartur/django-fobi/archive/stable.tar.gz

Or latest stable version from BitBucket:

pip install https://bitbucket.org/barseghyanartur/django-fobi/get/stable.tar.gz
  1. Add fobi to INSTALLED_APPS of the your projects’ Django settings. Furthermore, all themes and plugins to be used, shall be added to the INSTALLED_APPS as well. Note, that if a plugin has additional dependencies, you should be mentioning those in the INSTALLED_APPS as well.
INSTALLED_APPS = (
    # Used by fobi
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'django.contrib.admin',

    # ...
    # `django-fobi` core
    'fobi',

    # `django-fobi` themes
    'fobi.contrib.themes.bootstrap3', # Bootstrap 3 theme
    'fobi.contrib.themes.foundation5', # Foundation 5 theme
    'fobi.contrib.themes.simple', # Simple theme

    # `django-fobi` form elements - fields
    'fobi.contrib.plugins.form_elements.fields.boolean',
    'fobi.contrib.plugins.form_elements.fields.checkbox_select_multiple',
    'fobi.contrib.plugins.form_elements.fields.date',
    'fobi.contrib.plugins.form_elements.fields.date_drop_down',
    'fobi.contrib.plugins.form_elements.fields.datetime',
    'fobi.contrib.plugins.form_elements.fields.decimal',
    'fobi.contrib.plugins.form_elements.fields.email',
    'fobi.contrib.plugins.form_elements.fields.file',
    'fobi.contrib.plugins.form_elements.fields.float',
    'fobi.contrib.plugins.form_elements.fields.hidden',
    'fobi.contrib.plugins.form_elements.fields.input',
    'fobi.contrib.plugins.form_elements.fields.integer',
    'fobi.contrib.plugins.form_elements.fields.ip_address',
    'fobi.contrib.plugins.form_elements.fields.null_boolean',
    'fobi.contrib.plugins.form_elements.fields.password',
    'fobi.contrib.plugins.form_elements.fields.radio',
    'fobi.contrib.plugins.form_elements.fields.regex',
    'fobi.contrib.plugins.form_elements.fields.select',
    'fobi.contrib.plugins.form_elements.fields.select_model_object',
    'fobi.contrib.plugins.form_elements.fields.select_multiple',
    'fobi.contrib.plugins.form_elements.fields.select_multiple_model_objects',
    'fobi.contrib.plugins.form_elements.fields.slug',
    'fobi.contrib.plugins.form_elements.fields.text',
    'fobi.contrib.plugins.form_elements.fields.textarea',
    'fobi.contrib.plugins.form_elements.fields.time',
    'fobi.contrib.plugins.form_elements.fields.url',

    # `django-fobi` form elements - content elements
    'fobi.contrib.plugins.form_elements.test.dummy',
    'easy_thumbnails', # Required by `content_image` plugin
    'fobi.contrib.plugins.form_elements.content.content_image',
    'fobi.contrib.plugins.form_elements.content.content_image_url',
    'fobi.contrib.plugins.form_elements.content.content_text',
    'fobi.contrib.plugins.form_elements.content.content_video',

    # `django-fobi` form handlers
    'fobi.contrib.plugins.form_handlers.db_store',
    'fobi.contrib.plugins.form_handlers.http_repost',
    'fobi.contrib.plugins.form_handlers.mail',

    # Other project specific apps
    'foo', # Test app
    # ...
)
  1. Make appropriate changes to the TEMPLATE_CONTEXT_PROCESSORS of the your projects’ Django settings.

And the following to the context processors.

TEMPLATE_CONTEXT_PROCESSORS = (
    # ...
    "fobi.context_processors.theme",
    # ...
)

Make sure that django.core.context_processors.request is in TEMPLATE_CONTEXT_PROCESSORS too.

  1. Configure URLs

Add the following line to urlpatterns of your urls module.

# View URLs
url(r'^fobi/', include('fobi.urls.view')),

# Edit URLs
url(r'^fobi/', include('fobi.urls.edit')),

Note, that some plugins require additional URL includes. For instance, if you listed the fobi.contrib.plugins.form_handlers.db_store form handler plugin in the INSTALLED_APPS, you should mention the following in urls module.

# DB Store plugin URLs
url(r'^fobi/plugins/form-handlers/db-store/',
    include('fobi.contrib.plugins.form_handlers.db_store.urls')),

View URLs are put separately from edit URLs in order to make it possible to prefix the edit URLs differently. For example, if you’re using the “Simple” theme, you would likely want to prefix the edit URLs with “admin/” so that it looks more like django-admin.

Creating a new form element plugin

Form element plugins represent the elements of which the forms is made: Inputs, checkboxes, textareas, files, hidden fields, as well as pure presentational elements (text or image). Number of form elements in a form is not limited.

Presentational form elements are inherited from fobi.base.FormElementPlugin.

The rest (real form elements, that are supposed to have a value) are inherited from fobi.base.FormFieldPlugin.

You should see a form element plugin as a Django micro app, which could have its’ own models, admin interface, etc.

django-fobi comes with several bundled form element plugins. Do check the source code as example.

Let’s say, you want to create a textarea form element plugin.

There are several properties, each textarea should have. They are:

  • label (string): HTML label of the textarea.
  • name (string): HTML name of the textarea.
  • initial (string): Initial value of the textarea.
  • required (bool): Flag, which tells us whether the field is required or optional.

Let’s name that plugin sample_textarea. The plugin directory should then have the following structure.

path/to/sample_textarea/
├── __init__.py
├── fobi_form_elements.py # Where plugins are defined and registered
├── forms.py # Plugin configuration form
└── widgets.py # Where plugins widgets are defined

Form element plugins should be registered in “fobi_form_elements.py” file. Each plugin module should be put into the INSTALLED_APPS of your Django projects’ settings.

In some cases, you would need plugin specific overridable settings (see fobi.contrib.form_elements.fields.content.content_image plugin as an example). You are advised to write your settings in such a way, that variables of your Django project settings module would have FOBI_PLUGIN_ prefix.

Define and register the form element plugin

Step by step review of a how to create and register a plugin and plugin widgets. Note, that django-fobi auto-discovers your plugins if you place them into a file named fobi_form_elements.py of any Django app listed in INSTALLED_APPS of your Django projects’ settings module.

path/to/sample_textarea/fobi_form_elements.py

A single form element plugin is registered by its’ UID.

Required imports.

from django import forms
from fobi.base import FormFieldPlugin, form_element_plugin_registry
from path.to.sample_textarea.forms import SampleTextareaForm

Defining the Sample textarea plugin.

class SampleTextareaPlugin(FormFieldPlugin):
    """Sample textarea plugin."""

    uid = "sample_textarea"
    name = "Sample Textarea"
    form = SampleTextareaForm
    group = "Samples" # Group to which the plugin belongs to

    def get_form_field_instances(self, request=None, form_entry=None,
                                 form_element_entries=None, **kwargs):
        kwargs = {
            'required': self.data.required,
            'label': self.data.label,
            'initial': self.data.initial,
            'widget': forms.widgets.Textarea(attrs={})
        }

        return [(self.data.name, forms.CharField, kwargs),]

Registering the SampleTextareaPlugin plugin.

form_element_plugin_registry.register(SampleTextareaPlugin)

Note, that in case you want to define a pure presentational element, make use of fobi.base.FormElementPlugin for subclassing, instead of fobi.base.FormFieldPlugin. See the source of the content plugins (fobi.contrib.plugins.form_elements.content) as a an example.

For instance, the captcha and honeypot fields are implemented as form elements (subclasses the fobi.base.FormElementPlugin). The db_store form handler plugin does not save the form data of those elements. If you want the form element data to be saved, do inherit from fobi.base.FormFieldPlugin.

Hidden form element plugins, should be also having set the is_hidden property to True. By default it’s set to False. That makes the hidden form elements to be rendered using as django.forms.widgets.TextInput widget in edit mode. In the view mode, the original widget that you assigned in your form element plugin would be used.

There might be cases, when you need to do additional handling of the data upon the successful form submission. In such cases, you will need to define a submit_plugin_form_data method in the plugin, which accepts the following arguments:

  • form_entry (fobi.models.FormEntry): Form entry, which is being submitted.
  • request (django.http.HttpRequest): The Django HTTP request.
  • form (django.forms.Form): Form object (a valid one, which contains the cleaned_data attribute).
  • form_element_entries (fobi.models.FormElementEntry): Form element entries for the form_entry given.
  • (**)kwargs : Additional arguments.

Example (taken from fobi.contrib.plugins.form_elements.fields.file):

def submit_plugin_form_data(self, form_entry, request, form,
                            form_element_entries=None, **kwargs):
    """Submit plugin form data."""
    # Get the file path
    file_path = form.cleaned_data.get(self.data.name, None)
    if file_path:
        # Handle the upload
        saved_file = handle_uploaded_file(FILES_UPLOAD_DIR, file_path)
        # Overwrite ``cleaned_data`` of the ``form`` with path to moved
        # file.
        form.cleaned_data[self.data.name] = "{0}{1}".format(
            settings.MEDIA_URL, saved_file
        )

    # It's critically important to return the ``form`` with updated
    # ``cleaned_data``
    return form

In the example below, the original form is being modified. If you don’t want the original form to be modified, do not return anything.

Check the file form element plugin (fobi.contrib.plugins.form_elements.fields.file) for complete example.

path/to/sample_textarea/forms.py

Why to have another file for defining forms? Just to keep the code clean and less messy, although you could perfectly define all your plugin forms in the module fobi_form_elements.py, it’s recommended to keep it separate.

Take into consideration, that forms.py is not an auto-discovered file pattern. All your form element plugins should be registered in modules named fobi_form_elements.py.

Required imports.

from django import forms
from fobi.base import BasePluginForm

Form for for SampleTextareaPlugin form element plugin.

class SampleTextareaForm(forms.Form, BasePluginForm):
    """Sample textarea form."""

    plugin_data_fields = [
        ("name", ""),
        ("label", ""),
        ("initial", ""),
        ("required", False)
    ]

    name = forms.CharField(label="Name", required=True)
    label = forms.CharField(label="Label", required=True)
    initial = forms.CharField(label="Initial", required=False)
    required = forms.BooleanField(label="Required", required=False)

Note that although it’s not being checked in the code, but for form field plugins the following fields should be present in the plugin form (BasePluginForm) and the form plugin (FormFieldPlugin):

  • name

In some cases, you might want to do something with the data before it gets saved. For that purpose, save_plugin_data method has been introduced.

See the following example.

def save_plugin_data(self, request=None):
    """Saving the plugin data and moving the file."""
    file_path = self.cleaned_data.get('file', None)
    if file_path:
        saved_image = handle_uploaded_file(IMAGES_UPLOAD_DIR, file_path)
        self.cleaned_data['file'] = saved_image

path/to/sample_textarea/widgets.py

Required imports.

from fobi.base import FormElementPluginWidget

Defining the base plugin widget.

class BaseSampleTextareaPluginWidget(FormElementPluginWidget):
    """Base sample textarea plugin widget."""

    # Same as ``uid`` value of the ``SampleTextareaPlugin``.
    plugin_uid = "sample_textarea"

path/to/sample_layout/fobi_form_elements.py

Register in the registry (in some module which is for sure to be loaded; it’s handy to do it in the theme module).

Required imports.

from fobi.base import form_element_plugin_widget_registry
from path.to.sample_textarea.widgets import BaseSampleTextareaPluginWidget

Define the theme specific plugin.

class SampleTextareaPluginWidget(BaseSampleTextareaPluginWidget):
    """Sample textarea plugin widget."""

    theme_uid = 'bootstrap3' # Theme for which the widget is loaded
    media_js = [
        'sample_layout/js/fobi.plugins.form_elements.sample_textarea.js',
    ]
    media_css = [
        'sample_layout/css/fobi.plugins.form_elements.sample_textarea.css',
    ]

Register the widget.

form_element_plugin_widget_registry.register(SampleTextareaPluginWidget)

Form element plugin final steps

Now, that everything is ready, make sure your plugin module is added to INSTALLED_APPS.

INSTALLED_APPS = (
    # ...
    'path.to.sample_textarea',
    # ...
)

Afterwards, go to terminal and type the following command.

./manage.py fobi_sync_plugins

If your HTTP server is running, you would then be able to see the new plugin in the edit form interface.

Dashboard URL: http://127.0.0.1:8000/fobi/

Note, that you have to be logged in, in order to use the dashboard. If your new plugin doesn’t appear, set the FOBI_DEBUG to True in your Django’s local settings module, re-run your code and check console for error notifications.

Creating a new form handler plugin

Form handler plugins handle the form data. django-fobi comes with several bundled form handler plugins, among which is the db_store and mail plugins, which are responsible for saving the submitted form data into the database and mailing the data to recipients specified. Number of form handlers in a form is not limited. Certain form handlers are not configurable (for example the db_store form handler isn’t), while others are (mail, http_repost).

You should see a form handler as a Django micro app, which could have its’ own models, admin interface, etc.

By default, it’s possible to use a form handler plugin multiple times per form. If you wish to allow form handler plugin to be used only once in a form, set the allow_multiple property of the plugin to False.

As said above, django-fobi comes with several bundled form handler plugins. Do check the source code as example.

Define and register the form handler plugin

Let’s name that plugin sample_mail. The plugin directory should then have the following structure.

path/to/sample_mail/
├── __init__.py
├── fobi_form_handlers.py  # Where plugins are defined and registered
└── forms.py  # Plugin configuration form

Form handler plugins should be registered in “fobi_form_handlers.py” file. Each plugin module should be put into the INSTALLED_APPS of your Django projects’ settings.

path/to/sample_mail/fobi_form_handlers.py

A single form handler plugin is registered by its’ UID.

Required imports.

import json
from django.core.mail import send_mail
from fobi.base import FormHandlerPlugin, form_handler_plugin_registry
from path.to.sample_mail.forms import SampleMailForm

Defining the Sample mail handler plugin.

class SampleMailHandlerPlugin(FormHandlerPlugin):
    """Sample mail handler plugin."""

    uid = "sample_mail"
    name = _("Sample mail")
    form = SampleMailForm

    def run(self, form_entry, request, form):
        """To be executed by handler."""
        send_mail(
            self.data.subject,
            json.dumps(form.cleaned_data),
            self.data.from_email,
            [self.data.to_email],
            fail_silently=True
        )

Some form handlers are configurable, some others not. In order to have a user friendly way of showing the form handler settings, what’s sometimes needed, a plugin_data_repr method has been introduced. Simplest implementation of it would look as follows:

def plugin_data_repr(self):
    """Human readable representation of plugin data.

    :return string:
    """
    return self.data.__dict__

path/to/sample_mail/forms.py

If plugin is configurable, it has configuration data. A single form may have unlimited number of same plugins. Imagine, you want to have different subjects and additional body texts for different user groups. You could then assign two form handler mail plugins to the form. Of course, saving the posted form data many times does not make sense, but it’s up to the user. So, in case if plugin is configurable, it should have a form.

Why to have another file for defining forms? Just to keep the code clean and less messy, although you could perfectly define all your plugin forms in the module fobi_form_handlers.py, it’s recommended to keep it separate.

Take into consideration, that forms.py is not an auto-discovered file pattern. All your form handler plugins should be registered in modules named fobi_form_handlers.py.

Required imports.

from django import forms
from django.utils.translation import ugettext_lazy as _
from fobi.base import BasePluginForm

Defining the form for Sample mail handler plugin.

class MailForm(forms.Form, BasePluginForm):
    """Mail form."""

    plugin_data_fields = [
        ("from_name", ""),
        ("from_email", ""),
        ("to_name", ""),
        ("to_email", ""),
        ("subject", ""),
        ("body", ""),
    ]

    from_name = forms.CharField(label=_("From name"), required=True)
    from_email = forms.EmailField(label=_("From email"), required=True)
    to_name = forms.CharField(label=_("To name"), required=True)
    to_email = forms.EmailField(label=_("To email"), required=True)
    subject = forms.CharField(label=_("Subject"), required=True)
    body = forms.CharField(label=_("Body"), required=False,
                           widget=forms.widgets.Textarea)

After the plugin has been processed, all its’ data is available in a plugin_instance.data container (for example, plugin_instance.data.subject or plugin_instance.data.from_name).

Prioritise the execution order

Some form handlers shall be executed prior others. A good example of such, is a combination of “mail” and “db_save” form handlers for the form. In case if large files are posted, submission of form data would fail if “mail” plugin would be executed after “db_save” has been executed. That’s why it’s possible to prioritise that ordering in a FOBI_FORM_HANDLER_PLUGINS_EXECUTION_ORDER setting variable.

If not specified or left empty, form handler plugins would be ran in the order of discovery. All form handler plugins that are not listed in the FORM_HANDLER_PLUGINS_EXECUTION_ORDER, would be ran after the plugins that are mentioned there.

FORM_HANDLER_PLUGINS_EXECUTION_ORDER = (
    'http_repost',
    'mail',
    # The 'db_store' is left out intentionally, since it should
    # be the last plugin to be executed.
)

Form handler plugin custom actions

By default, a single form handler plugin has at least a “delete” action. If plugin is configurable, it gets an “edit” action as well.

For some of your plugins, you may want to register a custom action. For example, the “db_store” plugin does have one, for showing a link to a listing page with saved form data for the form given.

For such cases, define a custom_actions method in your form handler plugin. That method shall return a list of triples. In each triple, first value is the URL, second value is the title and the third value is the icon of the URL.

The following example is taken from the “db_store” plugin.

def custom_actions(self):
    """Adding a link to view the saved form entries.

    :return iterable:
    """
    return (
        (
            reverse('fobi.contrib.plugins.form_handlers.db_store.view_saved_form_data_entries'),
            _("View entries"),
            'glyphicon glyphicon-list'
        ),
    )

Form handler plugin final steps

Do not forget to add the form handler plugin module to INSTALLED_APPS.

INSTALLED_APPS = (
    # ...
    'path.to.sample_mail',
    # ...
)

Afterwards, go to terminal and type the following command.

./manage.py fobi_sync_plugins

If your HTTP server is running, you would then be able to see the new plugin in the edit form interface.

Creating a new form importer plugin

Form importer plugins import the forms from some external data source into django-fobi form format. Number of form importers is not limited. Form importers are implemented in forms of wizards (since they may contain several steps).

You should see a form importer as a Django micro app, which could have its’ own models, admin interface, etc.

At the moment django-fobi comes with only one bundled form handler plugin, which is the mailchimp_importer, which is responsible for importing existing MailChimp forms into django-fobi.

Define and register the form importer plugin

Let’s name that plugin sample_importer. The plugin directory should then have the following structure.

path/to/sample_importer/
├── templates
│   └── sample_importer
│       ├── 0.html
│       └── 1.html
├── __init__.py
├── fobi_form_importers.py # Where plugins are defined and registered
├── forms.py # Wizard forms
└── views.py # Wizard views

Form importer plugins should be registered in “fobi_form_importers.py” file. Each plugin module should be put into the INSTALLED_APPS of your Django projects’ settings.

path/to/sample_importer/fobi_form_importers.py

A single form importer plugin is registered by its’ UID.

Required imports.

from django.utils.translation import ugettext_lazy as _
from fobi.form_importers import BaseFormImporter, form_importer_plugin_registry
from fobi.contrib.plugins.form_elements import fields
from path.to.sample_importer.views import SampleImporterWizardView

Defining the Sample importer plugin.

class SampleImporterPlugin(FormHandlerPlugin):
    """Sample importer plugin."""

    uid = 'sample_importer'
    name = _("Sample importer)
    wizard = SampleImporterWizardView
    templates = [
        'sample_importer/0.html',
        'sample_importer/1.html',
    ]

    # field_type (at importer): uid (django-fobi)
    fields_mapping = {
        # Implemented
        'email': fields.email.UID,
        'text': fields.text.UID,
        'number': fields.integer.UID,
        'dropdown': fields.select.UID,
        'date': fields.date.UID,
        'url': fields.url.UID,
        'radio': fields.radio.UID,

        # Transformed into something else
        'address': fields.text.UID,
        'zip': fields.text.UID,
        'phone': fields.text.UID,
    }

    # Django standard: remote
    field_properties_mapping = {
        'label': 'name',
        'name': 'tag',
        'help_text': 'helptext',
        'initial': 'default',
        'required': 'req',
        'choices': 'choices',
    }

    field_type_prop_name = 'field_type'
    position_prop_name = 'order'

    def extract_field_properties(self, field_data):
        field_properties = {}
        for prop, val in self.field_properties_mapping.items():
            if val in field_data:
                if 'choices' == val:
                    field_properties[prop] = "\n".join(field_data[val])
                else:
                    field_properties[prop] = field_data[val]
        return field_properties


form_importer_plugin_registry.register(SampleImporter)

path/to/sample_importer/forms.py

As mentioned above, form importers are implemented in form of wizards. The forms are the wizard steps.

Required imports.

from django import forms
from django.utils.translation import ugettext_lazy as _
from sample_service_api import sample_api  # Just an imaginary API client

Defining the form for Sample importer plugin.

class SampleImporterStep1Form(forms.Form):
    """First form the the wizard."""

    api_key = forms.CharField(required=True)


class SampleImporterStep2Form(forms.Form):
    """Second form of the wizard."""

    list_id = forms.ChoiceField(required=True, choices=[])

    def __init__(self, *args, **kwargs):
        self._api_key = None

        if 'api_key' in kwargs:
            self._api_key = kwargs.pop('api_key', None)

        super(SampleImporterStep2Form, self).__init__(*args, **kwargs)

        if self._api_key:
            client = sample_api.Api(self._api_key)
            lists = client.lists.list()
            choices = [(l['id'], l['name']) for l in lists['data']]
            self.fields['list_id'].choices = choices

path/to/sample_importer/views.py

The wizard views.

Required imports.

from sample_service_api import sample_api  # Just an imaginary API client

from django.shortcuts import redirect
from django.core.urlresolvers import reverse
from django.contrib import messages
from django.utils.translation import ugettext_lazy as _

# For django LTE 1.8 import from `django.contrib.formtools.wizard.views`
from formtools.wizard.views import SessionWizardView

from path.to.sample_importer.forms import (
    SampleImporterStep1Form,
    SampleImporterStep2Form,
)

Defining the wizard view for Sample importer plugin.

class SampleImporterWizardView(SessionWizardView):
    """Sample importer wizard view."""

    form_list = [SampleImporterStep1Form, SampleImporterStep2Form]

    def get_form_kwargs(self, step):
        """Get form kwargs (to be used internally)."""
        if '1' == step:
            data = self.get_cleaned_data_for_step('0') or {}
            api_key = data.get('api_key', None)
            return {'api_key': api_key}
        return {}

    def done(self, form_list, **kwargs):
        """After all forms are submitted."""
        # Merging cleaned data into one dict
        cleaned_data = {}
        for form in form_list:
            cleaned_data.update(form.cleaned_data)

        # Connecting to sample client API
        client = sample_client.Api(cleaned_data['api_key'])

        # Fetching the form data
        form_data = client.lists.merge_vars(
            id={'list_id': cleaned_data['list_id']}
        )

        # We need the first form only
        try:
            form_data = form_data['data'][0]
        except Exception as err:
            messages.warning(
                self.request,
                _('Selected form could not be imported due errors.')
            )
            return redirect(reverse('fobi.dashboard'))

        # Actually, import the form
        form_entry = self._form_importer.import_data(
            {'name': form_data['name'], 'user': self.request.user},
            form_data['merge_vars']
        )

        redirect_url = reverse(
            'fobi.edit_form_entry', kwargs={'form_entry_id': form_entry.pk}
        )

        messages.info(
            self.request,
            _('Form {0} imported successfully.').format(form_data['name'])
        )

        return redirect("{0}".format(redirect_url))

Form importer plugin final steps

Do not forget to add the form importer plugin module to INSTALLED_APPS.

INSTALLED_APPS = (
    # ...
    'path.to.sample_importer',
    # ...
)

Afterwards, go to terminal and type the following command.

./manage.py fobi_sync_plugins

If your HTTP server is running, you would then be able to see the new plugin in the dashboard form interface (implemented in all bundled themes).

Creating a form callback

Form callbacks are additional hooks, that are executed on various stages of the form submission.

Let’s place the callback in the foo module. The plugin directory should then have the following structure.

path/to/foo/
├── __init__.py
└── fobi_form_callbacks.py # Where callbacks are defined and registered

See the callback example below.

Required imports.

from fobi.constants import (
    CALLBACK_BEFORE_FORM_VALIDATION,
    CALLBACK_FORM_VALID_BEFORE_SUBMIT_PLUGIN_FORM_DATA,
    CALLBACK_FORM_VALID, CALLBACK_FORM_VALID_AFTER_FORM_HANDLERS,
    CALLBACK_FORM_INVALID
)
from fobi.base import FormCallback, form_callback_registry

Define and register the callback

class SampleFooCallback(FormCallback):
    """Sample foo callback."""

    stage = CALLBACK_FORM_VALID

    def callback(self, form_entry, request, form):
        """Define your callback code here."""
        print("Great! Your form is valid!")

form_callback_registry.register(SampleFooCallback)

Add the callback module to INSTALLED_APPS.

INSTALLED_APPS = (
    # ...
    'path.to.foo',
    # ...
)

Suggestions

Custom action for the form

Sometimes, you would want to specify a different action for the form. Although it’s possible to define a custom form action (action field in the “Form properties” tab), you’re advised to use the http_repost plugin instead, since then the form would be still validated locally and only then the valid data, as is, would be sent to the desired endpoint.

Take in mind, that if both cases, if CSRF protection is enabled on the endpoint, your post request would result an error.

When you want to customise too many things

django-fobi, with its’ flexible form elements, form handlers and form callbacks is very customisable. However, there might be cases when you need to override entire view to fit your needs. Take a look at the FeinCMS integration or DjangoCMS integration as a good example of such. You may also want to compare the code from original view fobi.views.view_form_entry with the code from the widget to get a better idea of what could be changed in your case. If need a good advice, just ask me.

Theming

django-fobi comes with theming API. While there are several ready-to-use themes:

  • “Bootstrap 3” theme
  • “Foundation 5” theme
  • “Simple” theme in (with editing interface in style of the Django admin)
  • “DjangoCMS admin style” theme (which is another simple theme with editing interface in style of djangocms-admin-style)

Obviously, there are two sorts of views when it comes to editing and viewing the form.

  • The “view-view”, when the form as it has been made is exposed to the site end- users/visitors.
  • The “edit-view” (builder view), where the authorised users build their forms.

Both “Bootstrap 3” and “Foundation 5” themes are making use of the same style for both “view-view” and “edit-view” views.

Both “Simple” and “DjangoCMS admin style” themes are styling for the “edit-view” only. The “view-view” is pretty much blank, as shown on the one of the screenshots [2.6].

Have in mind, that creating a brand new theme could be time consuming. Instead, you are advised to extend existing themes or in the worst case, if too much customisation required, create your own themes based on existing ones (just copy the desired theme to your project directory and work it out further).

It’s possible to use different templates for all “view” and “edit” actions (see the source code of the “simple” theme). Both “Bootstrap 3” and “Foundation 5” themes look great. Although if you can’t use any of those, the “Simple” theme is the best start, since it looks just like django-admin.

Create a new theme

Let’s place the theme in the sample_theme module. The theme directory should then have the following structure.

path/to/sample_theme/
├── static
│   ├── css
│   │   └── sample_theme.css
│   └── js
│       └── sample_theme.js
├── templates
│   └── sample_theme
│       ├── _base.html
│       ├── add_form_element_entry.html
│       ├── ...
│       └── view_form_entry_ajax.html
├── __init__.py
├── fobi_form_elements.py
└── fobi_themes.py # Where themes are defined and registered

See the theme example below.

from django.utils.translation import ugettext_lazy as _

from fobi.base import BaseTheme, theme_registry

class SampleTheme(BaseTheme):
    """Sample theme."""

    uid = 'sample'
    name = _("Sample")

    media_css = (
        'sample_theme/css/sample_theme.css',
        'css/fobi.core.css',
    )

    media_js = (
        'js/jquery-1.10.2.min.js',
        'jquery-ui/js/jquery-ui-1.10.3.custom.min.js',
        'js/jquery.slugify.js',
        'js/fobi.core.js',
        'sample_theme/js/sample_theme.js',
    )

    # Form element specific
    form_element_html_class = 'form-control'
    form_radio_element_html_class = 'radio'
    form_element_checkbox_html_class = 'checkbox'

    form_edit_form_entry_option_class = 'glyphicon glyphicon-edit'
    form_delete_form_entry_option_class = 'glyphicon glyphicon-remove'
    form_list_container_class = 'list-inline'

    # Templates
    master_base_template = 'sample_theme/_base.html'
    base_template = 'sample_theme/base.html'

    form_ajax = 'sample_theme/snippets/form_ajax.html'
    form_snippet_template_name = 'sample_theme/snippets/form_snippet.html'
    form_properties_snippet_template_name = 'sample_theme/snippets/form_properties_snippet.html'
    messages_snippet_template_name = 'sample_theme/snippets/messages_snippet.html'

    add_form_element_entry_template = 'sample_theme/add_form_element_entry.html'
    add_form_element_entry_ajax_template = 'sample_theme/add_form_element_entry_ajax.html'

    add_form_handler_entry_template = 'sample_theme/add_form_handler_entry.html'
    add_form_handler_entry_ajax_template = 'sample_theme/add_form_handler_entry_ajax.html'

    create_form_entry_template = 'sample_theme/create_form_entry.html'
    create_form_entry_ajax_template = 'bootstrap3/create_form_entry_ajax.html'

    dashboard_template = 'sample_theme/dashboard.html'

    edit_form_element_entry_template = 'sample_theme/edit_form_element_entry.html'
    edit_form_element_entry_ajax_template = 'sample_theme/edit_form_element_entry_ajax.html'

    edit_form_entry_template = 'sample_theme/edit_form_entry.html'
    edit_form_entry_ajax_template = 'sample_theme/edit_form_entry_ajax.html'

    edit_form_handler_entry_template = 'sample_theme/edit_form_handler_entry.html'
    edit_form_handler_entry_ajax_template = 'sample_theme/edit_form_handler_entry_ajax.html'

    form_entry_submitted_template = 'sample_theme/form_entry_submitted.html'
    form_entry_submitted_ajax_template = 'sample_theme/form_entry_submitted_ajax.html'

    view_form_entry_template = 'sample_theme/view_form_entry.html'
    view_form_entry_ajax_template = 'sample_theme/view_form_entry_ajax.html'

Registering the SampleTheme plugin.

theme_registry.register(SampleTheme)

Sometimes you would want to attach additional properties to the theme in order to use them later in templates (remember, current theme object is always available in templates under name fobi_theme).

For such cases you would need to define a variable in your project’s settings module, called FOBI_CUSTOM_THEME_DATA. See the following code as example:

# `django-fobi` custom theme data for to be displayed in third party apps
# like `django-registraton`.
FOBI_CUSTOM_THEME_DATA = {
    'bootstrap3': {
        'page_header_html_class': '',
        'form_html_class': 'form-horizontal',
        'form_button_outer_wrapper_html_class': 'control-group',
        'form_button_wrapper_html_class': 'controls',
        'form_button_html_class': 'btn',
        'form_primary_button_html_class': 'btn-primary pull-right',
    },
    'foundation5': {
        'page_header_html_class': '',
        'form_html_class': 'form-horizontal',
        'form_button_outer_wrapper_html_class': 'control-group',
        'form_button_wrapper_html_class': 'controls',
        'form_button_html_class': 'radius button',
        'form_primary_button_html_class': 'btn-primary',
    },
    'simple': {
        'page_header_html_class': '',
        'form_html_class': 'form-horizontal',
        'form_button_outer_wrapper_html_class': 'control-group',
        'form_button_wrapper_html_class': 'submit-row',
        'form_button_html_class': 'btn',
        'form_primary_button_html_class': 'btn-primary',
    }
}

You would now be able to access the defined extra properties in templates as shown below.

<div class="{{ fobi_theme.custom_data.form_button_wrapper_html_class }}">

You likely would want to either remove the footer text or change it. Define a variable in your project’s settings module, called FOBI_THEME_FOOTER_TEXT. See the following code as example:

FOBI_THEME_FOOTER_TEXT = gettext('&copy; django-fobi example site 2014')

Below follow the properties of the theme:

  • base_edit
  • base_view

There are generic templates made in order to simplify theming. Some of them you would never need to override. Some others, you would likely want to.

Templates that you likely would want to re-write in your custom theme implementation are marked with three asterisks (***):

generic
├── snippets
│   ├── form_ajax.html
│   ├── form_edit_ajax.html
│   ├── *** form_properties_snippet.html
│   ├── *** form_snippet.html
│   ├── --- form_edit_snippet.html (does not exist in generic templates)
│   ├── --- form_view_snippet.html (does not exist in generic templates)
│   ├── form_view_ajax.html
│   └── messages_snippet.html
│
├── _base.html
├── add_form_element_entry.html
├── add_form_element_entry_ajax.html
├── add_form_handler_entry.html
├── add_form_handler_entry_ajax.html
├── base.html
├── create_form_entry.html
├── create_form_entry_ajax.html
├── *** dashboard.html
├── edit_form_element_entry.html
├── edit_form_element_entry_ajax.html
├── edit_form_entry.html
├── *** edit_form_entry_ajax.html
├── edit_form_handler_entry.html
├── edit_form_handler_entry_ajax.html
├── form_entry_submitted.html
├── *** form_entry_submitted_ajax.html
├── *** theme.html
├── view_form_entry.html
└── view_form_entry_ajax.html

From all of the templates listed above, the _base.html template is the most influenced by the Bootstrap 3 theme.

Make changes to an existing theme

As said above, making your own theme from scratch could be costly. Instead, you can override/reuse an existing one and change it to your needs with minimal efforts. See the override simple theme example. In order to see it in action, run the project with settings_override_simple_theme option:

./manage.py runserver --settings=settings_override_simple_theme

Details explained below.

Directory structure

override_simple_theme/
├── static
│   └── override_simple_theme
│       ├── css
│       │   └── override-simple-theme.css
│       └── js
│           └── override-simple-theme.js
│
├── templates
│   └── override_simple_theme
│       ├── snippets
│       │   └── form_ajax.html
│       └── base_view.html
├── __init__.py
└── fobi_themes.py # Where themes are defined and registered

fobi_themes.py

Overriding the “simple” theme.

__all__ = ('MySimpleTheme',)

from fobi.base import theme_registry

from fobi.contrib.themes.simple.fobi_themes import SimpleTheme

class MySimpleTheme(SimpleTheme):
    """My simple theme, inherited from `SimpleTheme` theme."""

    html_classes = ['my-simple-theme',]
    base_view_template = 'override_simple_theme/base_view.html'
    form_ajax = 'override_simple_theme/snippets/form_ajax.html'

Register the overridden theme. Note, that it’s important to set the force argument to True, in order to override the original theme. Force can be applied only once (for an overridden element).

theme_registry.register(MySimpleTheme, force=True)

templates/override_simple_theme/base_view.html

{% extends "simple/base_view.html" %}

{% load static %}

{% block stylesheets %}
<link
  href="{% static 'override_simple_theme/css/override-simple-theme.css' %}"
  rel="stylesheet" media="all" />
{% endblock stylesheets %}

{% block main-wrapper %}
<div id="sidebar">
  <h2>It's easy to override a theme!</h2>
</div>

{{ block.super }}
{% endblock main-wrapper %}

templates/override_simple_theme/snippets/form_ajax.html

{% extends "fobi/generic/snippets/form_ajax.html" %}

{% block form_html_class %}basic-grey{% endblock %}

Form wizards

Basics

With form wizards you can split forms across multiple pages. State is maintained in one of the backends (at the moment the Session backend). Data processing is delayed until the submission of the final form.

In django-fobi wizards work in the following way:

  • Number of forms in a form wizard is not limited.
  • Form callbacks, handlers are totally ignored in form wizards. Instead, the form-wizard specific handlers (form wizard handlers) take over handling of the form data on the final step.

Bundled form wizard handler plugins

Below a short overview of the form wizard handler plugins. See the README.rst file in directory of each plugin for details.

  • DB store: Stores form data in a database.
  • HTTP repost: Repost the POST request to another endpoint.
  • Mail: Send the form data by email.

Integration with third-party apps and frameworks

django-fobi has been successfully integrated into a number of diverse third-party apps and frameworks, such as: Django REST framework, Django CMS, FeinCMS and Mezzanine.

Certainly, integration into CMS is one case, integration into REST framework - totally another. In REST frameworks we no longer have forms as such. Context is very different. Handling of form data should obviously happen in a different way. Assembling of the form class isn’t enough (in case of Django REST framework we assemble the serializer class).

In order to handle such level of integration, two additional sort of plugins have been introduced:

  • IntegrationFormElementPlugin
  • IntegrationFormHandlerPlugin

These plugins are in charge of representation of the form elements in a proper way for the package to be integrated and handling the submitted form data.

Additional documentation is available in the sub-package.

Sample IntegrationFormElementPlugin

Sample is taken from here.

base.py

Define the form element plugin.

from django.utils.translation import ugettext_lazy as _

from rest_framework.fields import EmailField

from fobi.base import IntegrationFormFieldPlugin
from fobi.contrib.apps.drf_integration import UID as INTEGRATE_WITH_UID
from fobi.contrib.apps.drf_integration.base import (
    DRFIntegrationFormElementPluginProcessor,
    DRFSubmitPluginFormDataMixin,
)
from fobi.contrib.apps.drf_integration.form_elements.fields.email import UID


class EmailInputPlugin(IntegrationFormFieldPlugin,
                       DRFSubmitPluginFormDataMixin):
    """EmailField plugin."""

    uid = UID
    integrate_with = INTEGRATE_WITH_UID
    name = _("Decimal")
    group = _("Fields")

    def get_custom_field_instances(self,
                                   form_element_plugin,
                                   request=None,
                                   form_entry=None,
                                   form_element_entries=None,
                                   **kwargs):
        """Get form field instances."""
        field_kwargs = {
            'required': form_element_plugin.data.required,
            'initial': form_element_plugin.data.initial,
            'label': form_element_plugin.data.label,
            'help_text': form_element_plugin.data.help_text,
            'max_length': form_element_plugin.data.max_length,
        }
        return [
            DRFIntegrationFormElementPluginProcessor(
                field_class=EmailField,
                field_kwargs=field_kwargs
            )
        ]

fobi_integration_form_elements.py

Register the plugin. Note the name pattern fobi_integration_form_elements.

from fobi.base import integration_form_element_plugin_registry
from .base import EmailInputPlugin

integration_form_element_plugin_registry.register(EmailInputPlugin)

Don’t forget to list your plugin in the INSTALLED_APPS afterwards.

Sample IntegrationFormHandlerPlugin

Sample is taken from here.

base.py

Define the form handler plugin.

import logging
from mimetypes import guess_type
import os

from django.conf import settings
from django.utils.translation import ugettext_lazy as _

from fobi.base import IntegrationFormHandlerPlugin
from fobi.helpers import extract_file_path

from fobi.contrib.apps.drf_integration import UID as INTEGRATE_WITH_UID
from fobi.contrib.apps.drf_integration.base import get_processed_serializer_data

from . import UID


class MailHandlerPlugin(IntegrationFormHandlerPlugin):
    """Mail handler form handler plugin.

    Can be used only once per form.
    """

    uid = UID
    name = _("Mail")
    integrate_with = INTEGRATE_WITH_UID

    def run(self,
            form_handler_plugin,
            form_entry,
            request,
            form_element_entries=None,
            **kwargs):
        """Run."""
        base_url = form_handler_plugin.get_base_url(request)

        serializer = kwargs['serializer']

        # Clean up the values, leave our content fields and empty values.
        field_name_to_label_map, cleaned_data = get_processed_serializer_data(
            serializer,
            form_element_entries
        )

        rendered_data = form_handler_plugin.get_rendered_data(
            serializer.validated_data,
            field_name_to_label_map,
            base_url
        )

        files = self._prepare_files(request, serializer)

        form_handler_plugin.send_email(rendered_data, files)

    def _prepare_files(self, request, serializer):
        """Prepares the files for being attached to the mail message."""
        files = {}

        def process_path(file_path, imf):
            """Processes the file path and the file."""
            if file_path:
                file_path = file_path.replace(
                    settings.MEDIA_URL,
                    os.path.join(settings.MEDIA_ROOT, '')
                )
                mime_type = guess_type(imf.name)
                files[field_name] = (
                    imf.name,
                    ''.join([c for c in imf.chunks()]),
                    mime_type[0] if mime_type else ''
                )

        for field_name, imf in request.FILES.items():
            try:
                file_path = serializer.validated_data.get(field_name, '')
                process_path(file_path, imf)
            except Exception as err:
                file_path = extract_file_path(imf.name)
                process_path(file_path, imf)

        return files

fobi_integration_form_handlers.py

Register the plugin. Note the name pattern fobi_integration_form_handlers.

from fobi.base import integration_form_handler_plugin_registry
from .base import MailHandlerPlugin

integration_form_handler_plugin_registry.register(MailHandlerPlugin)

Don’t forget to list your plugin in the INSTALLED_APPS afterwards.

Permissions

Plugin system allows administrators to specify the access rights to every plugin. django-fobi permissions are based on Django Users and User Groups. Access rights are manageable via Django admin (“/admin/fobi/formelement/”, “/admin/fobi/formhandler/”). If user doesn’t have the rights to access plugin, it doesn’t appear on his form even if has been added to it (imagine, you have once granted the right to use the news plugin to all users, but later on decided to limit it to Staff members group only). Note, that superusers have access to all plugins.

        Plugin access rights management interface in Django admin

┌──────────────────────────┬───────────────────────┬───────────────────────┐
│ `Plugin`                 │ `Users`               │ `Groups`              │
├──────────────────────────┼───────────────────────┼───────────────────────┤
│ Text                     │ John Doe              │ Form builder users    │
├──────────────────────────┼───────────────────────┼───────────────────────┤
│ Textarea                 │                       │ Form builder users    │
├──────────────────────────┼───────────────────────┼───────────────────────┤
│ File                     │ Oscar, John Doe       │ Staff members         │
├──────────────────────────┼───────────────────────┼───────────────────────┤
│ URL                      │                       │ Form builder users    │
├──────────────────────────┼───────────────────────┼───────────────────────┤
│ Hidden                   │                       │ Form builder users    │
└──────────────────────────┴───────────────────────┴───────────────────────┘

Management commands

There are several management commands available.

  • fobi_find_broken_entries. Find broken form element/handler entries that occur when some plugin which did exist in the system, no longer exists.
  • fobi_sync_plugins. Should be ran each time a new plugin is being added to the django-fobi.
  • fobi_update_plugin_data. A mechanism to update existing plugin data in case if it had become invalid after a change in a plugin. In order for it to work, each plugin should implement and update method, in which the data update happens.

Tuning

There are number of django-fobi settings you can override in the settings module of your Django project:

  • FOBI_RESTRICT_PLUGIN_ACCESS (bool): If set to True, (Django) permission system for dash plugins is enabled. Defaults to True. Setting this to False makes all plugins available for all users.
  • FOBI_DEFAULT_THEME (str): Active (default) theme UID. Defaults to “bootstrap3”.
  • FORM_HANDLER_PLUGINS_EXECUTION_ORDER (list of tuples): Order in which the form handlers are executed. See the “Prioritise the execution order” section for details.

For tuning of specific contrib plugin, see the docs in the plugin directory.

Bundled plugins and themes

django-fobi ships with number of bundled form element- and form handler- plugins, as well as themes which are ready to be used as is.

Bundled form element plugins

Below a short overview of the form element plugins. See the README.rst file in directory of each plugin for details.

Content/presentation

Content plugins are presentational plugins, that make your forms look more complete and content rich.

Security

Test

Test plugins are made for dev purposes only.

  • Dummy: Solely for dev purposes.

Bundled form handler plugins

Below a short overview of the form handler plugins. See the README.rst file in directory of each plugin for details.

  • DB store: Stores form data in a database.
  • HTTP repost: Repost the POST request to another endpoint.
  • Mail: Send the form data by email.

Bundled themes

Below a short overview of the themes. See the README.rst file in directory of each theme for details.

Third-party plugins and themes

List of remarkable third-party plugins:

  • fobi-phonenumber - A Fobi PhoneNumber form field plugin. Makes use of the phonenumber_field.formfields.PhoneNumberField and phonenumber_field.widgets.PhoneNumberPrefixWidget.

HTML5 fields

The following HTML5 fields are supported in corresponding bundled plugins:

  • date
  • datetime
  • email
  • max
  • min
  • number
  • url
  • placeholder
  • type

With the fobi.contrib.plugins.form_elements.fields.input support for HTML5 fields is extended to the following fields:

  • autocomplete
  • autofocus
  • list
  • multiple
  • pattern
  • step

Loading initial data using GET arguments

It’s possible to provide initial data for the form using the GET arguments.

In that case, along with the field values, you should be providing an additional argument named “fobi_initial_data”, which doesn’t have to hold a value. For example, if your form contains of fields named “email” and “age” and you want to provide initial values for those using GET arguments, you should be constructing your URL to the form as follows:

http://127.0.0.1:8001/fobi/view/test-form/?fobi_initial_data&email=test@example.com&age=19

Dynamic initial values

It’s possible to provide a dynamic initial value for any of the text elements. In order to do that, you should use the build-in context processor or make your own one. The only requirement is that you should store all values that should be exposes in the form as a dict for fobi_dynamic_values dictionary key. Beware, that passing the original request object might be unsafe in many ways. Currently, a stripped down version of the request object is being passed as a context variable.

TEMPLATE_CONTEXT_PROCESSORS = (
    # ...
    "fobi.context_processors.dynamic_values",
    # ...
)
def dynamic_values(request):
    return {
        'fobi_dynamic_values': {
            'request': StrippedRequest(request),
            'now': datetime.datetime.now(),
            'today': datetime.date.today(),
        }
    }

In your GUI, you should be referring to the initial values in the following way:

{{ request.path }} {{ now }} {{ today }}

Note, that you should not provide the fobi_dynamic_values. as a prefix. Currently, the following variables are available in the fobi.context_processors.dynamic_values context processor:

- request: Stripped HttpRequest object.

    - request.path: A string representing the full path to the requested
      page, not including the scheme or domain.

    - request.get_full_path(): Returns the path, plus an appended query
      string, if applicable.

    - request.is_secure():  Returns True if the request is secure; that
      is, if it was made with HTTPS.

    - request.is_ajax(): Returns True if the request was made via an
      XMLHttpRequest, by checking the HTTP_X_REQUESTED_WITH header for the
      string 'XMLHttpRequest'.

    - request.META: A stripped down standard Python dictionary containing
      the available HTTP headers.

        - HTTP_ACCEPT_ENCODING: Acceptable encodings for the response.

        - HTTP_ACCEPT_LANGUAGE: Acceptable languages for the response.

        - HTTP_HOST: The HTTP Host header sent by the client.

        - HTTP_REFERER: The referring page, if any.

        - HTTP_USER_AGENT: The client’s user-agent string.

        - QUERY_STRING: The query string, as a single (un-parsed) string.

        - REMOTE_ADDR: The IP address of the client.

    - request.user: Authenticated user.

        - request.user.email:

        - request.user.get_username(): Returns the username for the user.
          Since the User model can be swapped out, you should use this
          method instead of referencing the username attribute directly.

        - request.user.get_full_name(): Returns the first_name plus the
          last_name, with a space in between.

        - request.user.get_short_name(): Returns the first_name.

        - request.user.is_anonymous():

- now: datetime.datetime.now()

- today: datetime.date.today()

Submitted form element plugins values

While some values of form element plugins are submitted as is, some others need additional processing. There are 3 types of behaviour taken into consideration:

  • “val”: value is being sent as is.
  • “repr”: (human readable) representation of the value is used.
  • “mix”: mix of value as is and human readable representation.

The following plugins have been made configurable in such a way, that developers can choose the desired behaviour in projects’ settings:

  • FOBI_FORM_ELEMENT_CHECKBOX_SELECT_MULTIPLE_SUBMIT_VALUE_AS
  • FOBI_FORM_ELEMENT_RADIO_SUBMIT_VALUE_AS
  • FOBI_FORM_ELEMENT_SELECT_SUBMIT_VALUE_AS
  • FOBI_FORM_ELEMENT_SELECT_MULTIPLE_SUBMIT_VALUE_AS
  • FOBI_FORM_ELEMENT_SELECT_MODEL_OBJECT_SUBMIT_VALUE_AS
  • FOBI_FORM_ELEMENT_SELECT_MULTIPLE_MODEL_OBJECTS_SUBMIT_VALUE_AS

See the README.rst in each of the following plugins for more information.

Rendering forms using third-party libraries

You might want to render your forms using third-party libraries such as django-crispy-forms, django-floppyforms or other alternatives.

For that purpose you should override the “snippets/form_snippet.html” used by the theme you have chosen. Your template would then look similar to the one below (make sure to setup/configure your third-party form rendering library prior doing this).

Using django-crispy-forms

{% load crispy_forms_tags fobi_tags %}

{% block form_non_field_and_hidden_errors %}
    {% get_form_hidden_fields_errors form as form_hidden_fields_errors %}
    {% if form.non_field_errors or form_hidden_fields_errors %}
        {% include fobi_theme.form_non_field_and_hidden_errors_snippet_template %}
    {% endif %}
{% endblock form_non_field_and_hidden_errors %}

{% crispy form %}

Using django-floppyforms

{% load floppyforms fobi_tags %}

{% block form_non_field_and_hidden_errors %}
    {% get_form_hidden_fields_errors form as form_hidden_fields_errors %}
    {% if form.non_field_errors or form_hidden_fields_errors %}
        {% include fobi_theme.form_non_field_and_hidden_errors_snippet_template %}
    {% endif %}
{% endblock form_non_field_and_hidden_errors %}

{% form form %}

See how it’s done in the override simple theme example.

Import/export forms

There might be cases when you have django-fobi running on multiple instances and have already spend some time on making forms on one of the instances, and want to reuse those forms on another. You could of course re-create entire form in the GUI, but we can do better than that. It’s possible to export forms into JSON format and import the exported forms again. It’s preferable that you run both instances on the same versions of django-fobi, otherwise imports might break (although it might just work). There are two scenarios to deal with missing plugin errors, which you have don’t yet have full control of. If both instances have the same set of form element and form handler plugins imports should go smoothly. It is though possible to make an import ignoring missing form element and form handler plugins. You would get an appropriate notice about that, but import will continue leaving the broken plugin data out.

Available translations

English is the primary language.

Debugging

By default debugging is turned off. It means that broken form entries, which are entries with broken data, that are not possible to be shown, are just skipped. That’s safe in production. Although, you for sure would want to see the broken entries in development. Set the FOBI_DEBUG to True in the settings.py of your project in order to do so.

Most of the errors are logged (DEBUG). If you have written a plugin and it somehow doesn’t appear in the list of available plugins, do run the following management command since it not only syncs your plugins into the database, but also is a great way of checking for possible errors.

./manage.py fobi_sync_plugins

Run the following command in order to identify the broken plugins.

./manage.py fobi_find_broken_entries

If you have forms referring to form element- of form handler- plugins that are currently missing (not registered, removed, failed to load - thus there would be a risk that your form would’t be rendered properly/fully and the necessary data handling wouldn’t happen either) you will get an appropriate exception. Although it’s fine to get an instant error message about such failures in development, in production is wouldn’t look appropriate. Thus, there are two settings related to the non-existing (not-found) form element- and form handler- plugins.

  • FOBI_DEBUG: Set this to True in your development environment anyway. Watch error logs closely.
  • FOBI_FAIL_ON_MISSING_FORM_ELEMENT_PLUGINS: If you want no error to be shown in case of missing form element plugins, set this to False in your settings module. Default value is True.
  • FOBI_FAIL_ON_MISSING_FORM_HANDLER_PLUGINS: If you want no error to be shown in case of missing form element handlers, set this to False in your settings module. Default value is True.

Testing

Project is covered by test (functional- and browser-tests).

To test with all supported Python/Django versions type:

tox

To test against specific environment, type:

tox -e pypy-django18

To test just your working environment type:

./runtests.py

It’s assumed that you have all the requirements installed. If not, first install the test requirements:

pip install -r examples/requirements/common_test_requirements.txt

Browser tests

For browser tests you may choose between Firefox, headless Firefox and PhantomJS. PhantomJS is faster, headless Firefox is fast as well, but normal Firefox tests tell you more (as you see what exactly happens on the screen). Both cases require some effort and both have disadvantages regarding the installation (although once you have them installed they work perfect).

Latest versions of Firefox are often not supported by Selenium. Current version of the Selenium for Python (2.53.6) works fine with Firefox 47. Thus, instead of using system Firefox you could better use a custom one.

For PhantomJS you need to have NodeJS installed.

Set up Firefox 47

  1. Download Firefox 47 from this location and unzip it into /usr/lib/firefox47/

  2. Specify the full path to your Firefox in FIREFOX_BIN_PATH setting. Example:

    FIREFOX_BIN_PATH = '/usr/lib/firefox47/firefox'
    

    If you set to use system Firefox, remove or comment-out the FIREFOX_BIN_PATH setting.

After that your Selenium tests would work.

Set up headless Firefox

  1. Install xvfb package which is used to start Firefox in headless mode.

    sudo apt-get install xvfb
    
  2. Run the tests using headless Firefox.

    ./scripts/runtests.sh
    

    Or run tox tests using headless Firefox.

    ./scripts/tox.sh
    

Setup PhantomJS

You could also run tests in headless mode (faster). For that you will need PhantomJS.

  1. Install PhantomJS and dependencies.

    curl -sL https://deb.nodesource.com/setup_6.x -o nodesource_setup.sh
    sudo bash nodesource_setup.sh
    sudo apt-get install nodejs
    sudo apt-get install build-essential libssl-dev
    sudo npm -g install phantomjs-prebuilt
    
  2. Specify the PHANTOM_JS_EXECUTABLE_PATH setting. Example:

    PHANTOM_JS_EXECUTABLE_PATH = ""
    

    If you want to use Firefox for testing, remove or comment-out the PHANTOM_JS_EXECUTABLE_PATH setting.

Writing documentation

Keep the following hierarchy.

=====
title
=====

header
======

sub-header
----------

sub-sub-header
~~~~~~~~~~~~~~

sub-sub-sub-header
##################

sub-sub-sub-sub-header
^^^^^^^^^^^^^^^^^^^^^^

sub-sub-sub-sub-sub-header
++++++++++++++++++++++++++

Troubleshooting

If you get a FormElementPluginDoesNotExist or a FormHandlerPluginDoesNotExist exception, make sure you have listed your plugin in the settings module of your project.

Contributing

If you want to contribute to the library, but don’t know where to start, do check the open issues where help is appreciated or ask the Author how you could help.

License

GPL 2.0/LGPL 2.1

Support

For any issues contact me at the e-mail given in the Author section.

Author

Artur Barseghyan <artur.barseghyan@gmail.com>

Screenshots

Bootstrap3 theme

Dashboard

[1.1]Dashboard
_images/01_dashboard.png

Create a form

[1.2]Create a form
_images/02_create_form.png

View/edit form

Form elements
[1.3]Edit form - form elements tab active, no elements yet
_images/03_edit_form_-_form_elements_tab_active_-_no_elements_yet.png
[1.4]Edit form - form elements tab active, add a form element menu
_images/04_edit_form_-_form_elements_tab_active_-_add_element_menu.png
[1.5]Edit form - add a form element (URL plugin)
_images/05_edit_form_-_add_form_element_url_plugin.png
[1.6]Edit form - form elements tab active, with form elements
_images/06_edit_form_-_form_elements_tab_active_-_with_elements.png
Form handlers
[1.7]Edit form - form handlers tab active, no handlers yet
_images/07_edit_form_-_form_handlers_tab_active_-_no_handlers_yet.png
[1.8]Edit form - form handlers tab tactive, add form handler menu
_images/08_edit_form_-_form_handlers_tab_active_-_add_handler_menu.png
[1.9]Edit form - add a form handler (Mail plugin)
_images/09_edit_form_-_add_form_handler_mail_plugin.png
[1.10]Edit form - form handlers tab active, with form handlers
_images/10_edit_form_-_form_handlers_tab_active_with_handlers.png
[1.11]Edit form - form properties tab active
_images/11_edit_form_-_form_properties_tab_active.png
[1.12]View form
_images/12_view_form.png
[1.13]View form - form submitted (thanks page)
_images/13_view_form_-_form_submitted.png
[1.14]Edit form - add a form element (Video plugin)
_images/14_edit_form_-_add_form_element_video_plugin.png
[1.15]Edit form - add a form element (Boolean plugin)
_images/15_edit_form_-_add_form_element_boolean_plugin.png
[1.16]Edit form
_images/16_edit_form.png
[1.17]View form
_images/17_view_form.png

Simple theme

View/edit form

[2.1]Edit form - form elements tab active, with form elements
_images/01_edit_form_-_form_elements_tab_active_with_elements.png
[2.2]Edit form - form elements tab active, add a form element menu
_images/02_edit_form_-_form_elements_tab_active_add_elements_menu.png
[2.3]Edit form - add a form element (Hidden plugin)
_images/03_edit_form_-_add_form_element_hidden.png
[2.4]Edit form - form handlers tab active, with form handlers
_images/04_edit_form_-_form_handlers_tab_active_with_handlers.png
[2.5]Edit form - form properties tab active
_images/05_edit_form_-_form_properties_tab_active.png
[2.6]View form
_images/06_view_form.png

Documentation

Contents:

fobi package

Subpackages

fobi.contrib package
Subpackages
fobi.contrib.apps package
Subpackages
fobi.contrib.apps.djangocms_integration package
Submodules
fobi.contrib.apps.djangocms_integration.apps module
class fobi.contrib.apps.djangocms_integration.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

Config.

label = 'fobi_contrib_apps_djangocms_integration'
name = 'fobi.contrib.apps.djangocms_integration'
fobi.contrib.apps.djangocms_integration.cms_plugins module
fobi.contrib.apps.djangocms_integration.cms_version module
fobi.contrib.apps.djangocms_integration.conf module
fobi.contrib.apps.djangocms_integration.conf.get_setting(setting, override=None)[source]

Get setting.

Get a setting from fobi.contrib.apps.djangocms_integration conf module, falling back to the default.

If override is not None, it will be used instead of the setting.

Parameters:
  • setting – String with setting name
  • override – Value to use when no setting is available. Defaults to None.
Returns:

Setting value.

fobi.contrib.apps.djangocms_integration.defaults module
fobi.contrib.apps.djangocms_integration.helpers module
fobi.contrib.apps.djangocms_integration.helpers.get_form_template_choices()[source]

Get the form template choices.

It’s possible to provide theme templates per theme or just per project.

Return list:
fobi.contrib.apps.djangocms_integration.helpers.get_success_page_template_choices()[source]

Get success page template choices.

Return list:
fobi.contrib.apps.djangocms_integration.models module
fobi.contrib.apps.djangocms_integration.settings module
  • WIDGET_FORM_SENT (str): Name of the GET param indicating that form has been successfully sent.
Module contents
fobi.contrib.apps.drf_integration package
Subpackages
fobi.contrib.apps.drf_integration.form_elements package
Subpackages
fobi.contrib.apps.drf_integration.form_elements.content package
Subpackages
fobi.contrib.apps.drf_integration.form_elements.content.content_image package
Submodules
fobi.contrib.apps.drf_integration.form_elements.content.content_image.apps module
class fobi.contrib.apps.drf_integration.form_elements.content.content_image.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

label = 'fobi_contrib_apps_drf_integration_form_elements_content_content_image'
name = 'fobi.contrib.apps.drf_integration.form_elements.content.content_image'
fobi.contrib.apps.drf_integration.form_elements.content.content_image.base module
class fobi.contrib.apps.drf_integration.form_elements.content.content_image.base.ContentImagePlugin(user=None)[source]

Bases: fobi.base.IntegrationFormElementPlugin, fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin

CharField plugin.

get_custom_field_instances(form_element_plugin, request=None, form_entry=None, form_element_entries=None, has_value=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
integrate_with = 'drf_integration'
name = <django.utils.functional.__proxy__ object>
uid = 'content_image'
fobi.contrib.apps.drf_integration.form_elements.content.content_image.fobi_integration_form_elements module
class fobi.contrib.apps.drf_integration.form_elements.content.content_image.fobi_integration_form_elements.ContentImagePlugin(user=None)[source]

Bases: fobi.base.IntegrationFormElementPlugin, fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin

CharField plugin.

get_custom_field_instances(form_element_plugin, request=None, form_entry=None, form_element_entries=None, has_value=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
integrate_with = 'drf_integration'
name = <django.utils.functional.__proxy__ object>
uid = 'content_image'
Module contents
fobi.contrib.apps.drf_integration.form_elements.content.content_image_url package
Submodules
fobi.contrib.apps.drf_integration.form_elements.content.content_image_url.apps module
class fobi.contrib.apps.drf_integration.form_elements.content.content_image_url.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

label = 'fobi_contrib_apps_drf_integration_form_elements_content_content_image_url'
name = 'fobi.contrib.apps.drf_integration.form_elements.content.content_image_url'
fobi.contrib.apps.drf_integration.form_elements.content.content_image_url.base module
class fobi.contrib.apps.drf_integration.form_elements.content.content_image_url.base.ContentImageURLPlugin(user=None)[source]

Bases: fobi.base.IntegrationFormElementPlugin, fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin

CharField plugin.

get_custom_field_instances(form_element_plugin, request=None, form_entry=None, form_element_entries=None, has_value=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
integrate_with = 'drf_integration'
name = <django.utils.functional.__proxy__ object>
uid = 'content_image_url'
fobi.contrib.apps.drf_integration.form_elements.content.content_image_url.fobi_integration_form_elements module
class fobi.contrib.apps.drf_integration.form_elements.content.content_image_url.fobi_integration_form_elements.ContentImageURLPlugin(user=None)[source]

Bases: fobi.base.IntegrationFormElementPlugin, fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin

CharField plugin.

get_custom_field_instances(form_element_plugin, request=None, form_entry=None, form_element_entries=None, has_value=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
integrate_with = 'drf_integration'
name = <django.utils.functional.__proxy__ object>
uid = 'content_image_url'
Module contents
fobi.contrib.apps.drf_integration.form_elements.content.content_text package
Submodules
fobi.contrib.apps.drf_integration.form_elements.content.content_text.apps module
class fobi.contrib.apps.drf_integration.form_elements.content.content_text.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

label = 'fobi_contrib_apps_drf_integration_form_elements_content_content_text'
name = 'fobi.contrib.apps.drf_integration.form_elements.content.content_text'
fobi.contrib.apps.drf_integration.form_elements.content.content_text.base module
class fobi.contrib.apps.drf_integration.form_elements.content.content_text.base.ContentTextPlugin(user=None)[source]

Bases: fobi.base.IntegrationFormElementPlugin, fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin

CharField plugin.

get_custom_field_instances(form_element_plugin, request=None, form_entry=None, form_element_entries=None, has_value=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
integrate_with = 'drf_integration'
name = <django.utils.functional.__proxy__ object>
uid = 'content_text'
fobi.contrib.apps.drf_integration.form_elements.content.content_text.fobi_integration_form_elements module
class fobi.contrib.apps.drf_integration.form_elements.content.content_text.fobi_integration_form_elements.ContentTextPlugin(user=None)[source]

Bases: fobi.base.IntegrationFormElementPlugin, fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin

CharField plugin.

get_custom_field_instances(form_element_plugin, request=None, form_entry=None, form_element_entries=None, has_value=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
integrate_with = 'drf_integration'
name = <django.utils.functional.__proxy__ object>
uid = 'content_text'
Module contents
fobi.contrib.apps.drf_integration.form_elements.content.content_video package
Submodules
fobi.contrib.apps.drf_integration.form_elements.content.content_video.apps module
class fobi.contrib.apps.drf_integration.form_elements.content.content_video.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

label = 'fobi_contrib_apps_drf_integration_form_elements_content_content_video'
name = 'fobi.contrib.apps.drf_integration.form_elements.content.content_video'
fobi.contrib.apps.drf_integration.form_elements.content.content_video.base module
class fobi.contrib.apps.drf_integration.form_elements.content.content_video.base.ContentVideoPlugin(user=None)[source]

Bases: fobi.base.IntegrationFormElementPlugin, fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin

CharField plugin.

get_custom_field_instances(form_element_plugin, request=None, form_entry=None, form_element_entries=None, has_value=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
integrate_with = 'drf_integration'
name = <django.utils.functional.__proxy__ object>
uid = 'content_video'
fobi.contrib.apps.drf_integration.form_elements.content.content_video.fobi_integration_form_elements module
class fobi.contrib.apps.drf_integration.form_elements.content.content_video.fobi_integration_form_elements.ContentVideoPlugin(user=None)[source]

Bases: fobi.base.IntegrationFormElementPlugin, fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin

CharField plugin.

get_custom_field_instances(form_element_plugin, request=None, form_entry=None, form_element_entries=None, has_value=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
integrate_with = 'drf_integration'
name = <django.utils.functional.__proxy__ object>
uid = 'content_video'
Module contents
Module contents
fobi.contrib.apps.drf_integration.form_elements.fields package
Subpackages
fobi.contrib.apps.drf_integration.form_elements.fields.boolean package
Submodules
fobi.contrib.apps.drf_integration.form_elements.fields.boolean.apps module
class fobi.contrib.apps.drf_integration.form_elements.fields.boolean.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

label = 'fobi_contrib_apps_drf_integration_form_elements_fields_boolean'
name = 'fobi.contrib.apps.drf_integration.form_elements.fields.boolean'
fobi.contrib.apps.drf_integration.form_elements.fields.boolean.base module
class fobi.contrib.apps.drf_integration.form_elements.fields.boolean.base.BooleanSelectPlugin(user=None)[source]

Bases: fobi.base.IntegrationFormFieldPlugin, fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin

Boolean select plugin.

get_custom_field_instances(form_element_plugin, request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
integrate_with = 'drf_integration'
name = <django.utils.functional.__proxy__ object>
uid = 'boolean'
fobi.contrib.apps.drf_integration.form_elements.fields.boolean.fobi_integration_form_elements module
class fobi.contrib.apps.drf_integration.form_elements.fields.boolean.fobi_integration_form_elements.BooleanSelectPlugin(user=None)[source]

Bases: fobi.base.IntegrationFormFieldPlugin, fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin

Boolean select plugin.

get_custom_field_instances(form_element_plugin, request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
integrate_with = 'drf_integration'
name = <django.utils.functional.__proxy__ object>
uid = 'boolean'
Module contents
fobi.contrib.apps.drf_integration.form_elements.fields.checkbox_select_multiple package
Submodules
fobi.contrib.apps.drf_integration.form_elements.fields.checkbox_select_multiple.apps module
class fobi.contrib.apps.drf_integration.form_elements.fields.checkbox_select_multiple.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

label = 'fobi_contrib_apps_drf_integration_form_elements_fields_checkbox_select_multiple'
name = 'fobi.contrib.apps.drf_integration.form_elements.fields.checkbox_select_multiple'
fobi.contrib.apps.drf_integration.form_elements.fields.checkbox_select_multiple.base module
class fobi.contrib.apps.drf_integration.form_elements.fields.checkbox_select_multiple.base.CheckboxSelectMultipleInputPlugin(user=None)[source]

Bases: fobi.base.IntegrationFormFieldPlugin, fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin

MultipleChoiceField plugin.

get_custom_field_instances(form_element_plugin, request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
integrate_with = 'drf_integration'
name = <django.utils.functional.__proxy__ object>
submit_plugin_form_data(form_element_plugin, form_entry, request, serializer, form_element_entries=None, **kwargs)[source]

Submit plugin form data.

Called on form submission (when user actually posts the data to assembled form).

Parameters:
  • form_element_plugin
  • form_entry (fobi.models.FormEntry) – Instance of fobi.models.FormEntry.
  • request (django.http.HttpRequest) –
  • serializer (rest_framework.serializers.Serializer) –
  • form_element_entries (iterable) –
uid = 'checkbox_select_multiple'
fobi.contrib.apps.drf_integration.form_elements.fields.checkbox_select_multiple.fobi_integration_form_elements module
class fobi.contrib.apps.drf_integration.form_elements.fields.checkbox_select_multiple.fobi_integration_form_elements.CheckboxSelectMultipleInputPlugin(user=None)[source]

Bases: fobi.base.IntegrationFormFieldPlugin, fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin

MultipleChoiceField plugin.

get_custom_field_instances(form_element_plugin, request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
integrate_with = 'drf_integration'
name = <django.utils.functional.__proxy__ object>
submit_plugin_form_data(form_element_plugin, form_entry, request, serializer, form_element_entries=None, **kwargs)[source]

Submit plugin form data.

Called on form submission (when user actually posts the data to assembled form).

Parameters:
  • form_element_plugin
  • form_entry (fobi.models.FormEntry) – Instance of fobi.models.FormEntry.
  • request (django.http.HttpRequest) –
  • serializer (rest_framework.serializers.Serializer) –
  • form_element_entries (iterable) –
uid = 'checkbox_select_multiple'
Module contents
fobi.contrib.apps.drf_integration.form_elements.fields.date package
Submodules
fobi.contrib.apps.drf_integration.form_elements.fields.date.apps module
class fobi.contrib.apps.drf_integration.form_elements.fields.date.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

label = 'fobi_contrib_apps_drf_integration_form_elements_fields_date'
name = 'fobi.contrib.apps.drf_integration.form_elements.fields.date'
fobi.contrib.apps.drf_integration.form_elements.fields.date.base module
class fobi.contrib.apps.drf_integration.form_elements.fields.date.base.DateSelectPlugin(user=None)[source]

Bases: fobi.base.IntegrationFormFieldPlugin, fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin

DateSelect select plugin.

get_custom_field_instances(form_element_plugin, request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
integrate_with = 'drf_integration'
name = <django.utils.functional.__proxy__ object>
uid = 'date'
fobi.contrib.apps.drf_integration.form_elements.fields.date.fobi_integration_form_elements module
class fobi.contrib.apps.drf_integration.form_elements.fields.date.fobi_integration_form_elements.DateSelectPlugin(user=None)[source]

Bases: fobi.base.IntegrationFormFieldPlugin, fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin

DateSelect select plugin.

get_custom_field_instances(form_element_plugin, request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
integrate_with = 'drf_integration'
name = <django.utils.functional.__proxy__ object>
uid = 'date'
Module contents
fobi.contrib.apps.drf_integration.form_elements.fields.date_drop_down package
Submodules
fobi.contrib.apps.drf_integration.form_elements.fields.date_drop_down.apps module
class fobi.contrib.apps.drf_integration.form_elements.fields.date_drop_down.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

label = 'fobi_contrib_apps_drf_integration_form_elements_fields_date_drop_down'
name = 'fobi.contrib.apps.drf_integration.form_elements.fields.date_drop_down'
fobi.contrib.apps.drf_integration.form_elements.fields.date_drop_down.base module
class fobi.contrib.apps.drf_integration.form_elements.fields.date_drop_down.base.DateDropDownSelectPlugin(user=None)[source]

Bases: fobi.base.IntegrationFormFieldPlugin, fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin

DateSelect select plugin.

get_custom_field_instances(form_element_plugin, request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
integrate_with = 'drf_integration'
name = <django.utils.functional.__proxy__ object>
uid = 'date_drop_down'
fobi.contrib.apps.drf_integration.form_elements.fields.date_drop_down.fobi_integration_form_elements module
class fobi.contrib.apps.drf_integration.form_elements.fields.date_drop_down.fobi_integration_form_elements.DateDropDownSelectPlugin(user=None)[source]

Bases: fobi.base.IntegrationFormFieldPlugin, fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin

DateSelect select plugin.

get_custom_field_instances(form_element_plugin, request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
integrate_with = 'drf_integration'
name = <django.utils.functional.__proxy__ object>
uid = 'date_drop_down'
Module contents
fobi.contrib.apps.drf_integration.form_elements.fields.datetime package
Submodules
fobi.contrib.apps.drf_integration.form_elements.fields.datetime.apps module
class fobi.contrib.apps.drf_integration.form_elements.fields.datetime.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

label = 'fobi_contrib_apps_drf_integration_form_elements_fields_datetime'
name = 'fobi.contrib.apps.drf_integration.form_elements.fields.datetime'
fobi.contrib.apps.drf_integration.form_elements.fields.datetime.base module
class fobi.contrib.apps.drf_integration.form_elements.fields.datetime.base.DateTimeSelectPlugin(user=None)[source]

Bases: fobi.base.IntegrationFormFieldPlugin, fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin

DateTimeSelect select plugin.

get_custom_field_instances(form_element_plugin, request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
integrate_with = 'drf_integration'
name = <django.utils.functional.__proxy__ object>
uid = 'datetime'
fobi.contrib.apps.drf_integration.form_elements.fields.datetime.fobi_integration_form_elements module
class fobi.contrib.apps.drf_integration.form_elements.fields.datetime.fobi_integration_form_elements.DateTimeSelectPlugin(user=None)[source]

Bases: fobi.base.IntegrationFormFieldPlugin, fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin

DateTimeSelect select plugin.

get_custom_field_instances(form_element_plugin, request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
integrate_with = 'drf_integration'
name = <django.utils.functional.__proxy__ object>
uid = 'datetime'
Module contents
fobi.contrib.apps.drf_integration.form_elements.fields.decimal package
Submodules
fobi.contrib.apps.drf_integration.form_elements.fields.decimal.apps module
class fobi.contrib.apps.drf_integration.form_elements.fields.decimal.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

label = 'fobi_contrib_apps_drf_integration_form_elements_fields_decimal'
name = 'fobi.contrib.apps.drf_integration.form_elements.fields.decimal'
fobi.contrib.apps.drf_integration.form_elements.fields.decimal.base module
class fobi.contrib.apps.drf_integration.form_elements.fields.decimal.base.DecimalInputPlugin(user=None)[source]

Bases: fobi.base.IntegrationFormFieldPlugin, fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin

DecimalField plugin.

get_custom_field_instances(form_element_plugin, request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
integrate_with = 'drf_integration'
name = <django.utils.functional.__proxy__ object>
uid = 'decimal'
fobi.contrib.apps.drf_integration.form_elements.fields.decimal.fobi_integration_form_elements module
class fobi.contrib.apps.drf_integration.form_elements.fields.decimal.fobi_integration_form_elements.DecimalInputPlugin(user=None)[source]

Bases: fobi.base.IntegrationFormFieldPlugin, fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin

DecimalField plugin.

get_custom_field_instances(form_element_plugin, request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
integrate_with = 'drf_integration'
name = <django.utils.functional.__proxy__ object>
uid = 'decimal'
Module contents
fobi.contrib.apps.drf_integration.form_elements.fields.email package
Submodules
fobi.contrib.apps.drf_integration.form_elements.fields.email.apps module
class fobi.contrib.apps.drf_integration.form_elements.fields.email.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

label = 'fobi_contrib_apps_drf_integration_form_elements_fields_email'
name = 'fobi.contrib.apps.drf_integration.form_elements.fields.email'
fobi.contrib.apps.drf_integration.form_elements.fields.email.base module
class fobi.contrib.apps.drf_integration.form_elements.fields.email.base.EmailInputPlugin(user=None)[source]

Bases: fobi.base.IntegrationFormFieldPlugin, fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin

EmailField plugin.

get_custom_field_instances(form_element_plugin, request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
integrate_with = 'drf_integration'
name = <django.utils.functional.__proxy__ object>
uid = 'email'
fobi.contrib.apps.drf_integration.form_elements.fields.email.fobi_integration_form_elements module
class fobi.contrib.apps.drf_integration.form_elements.fields.email.fobi_integration_form_elements.EmailInputPlugin(user=None)[source]

Bases: fobi.base.IntegrationFormFieldPlugin, fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin

EmailField plugin.

get_custom_field_instances(form_element_plugin, request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
integrate_with = 'drf_integration'
name = <django.utils.functional.__proxy__ object>
uid = 'email'
Module contents
fobi.contrib.apps.drf_integration.form_elements.fields.file package
Submodules
fobi.contrib.apps.drf_integration.form_elements.fields.file.apps module
class fobi.contrib.apps.drf_integration.form_elements.fields.file.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

label = 'fobi_contrib_apps_drf_integration_form_elements_fields_file'
name = 'fobi.contrib.apps.drf_integration.form_elements.fields.file'
fobi.contrib.apps.drf_integration.form_elements.fields.file.base module
class fobi.contrib.apps.drf_integration.form_elements.fields.file.base.FileInputPlugin(user=None)[source]

Bases: fobi.base.IntegrationFormFieldPlugin, fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin

FileField plugin.

get_custom_field_instances(form_element_plugin, request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
integrate_with = 'drf_integration'
name = <django.utils.functional.__proxy__ object>
submit_plugin_form_data(form_element_plugin, form_entry, request, serializer, form_element_entries=None, **kwargs)[source]

Submit plugin form data.

Called on form submission (when user actually posts the data to assembled form).

Parameters:
  • form_element_plugin
  • form_entry (fobi.models.FormEntry) – Instance of fobi.models.FormEntry.
  • request (django.http.HttpRequest) –
  • serializer (rest_framework.serializers.Serializer) –
  • form_element_entries (iterable) –
uid = 'file'
fobi.contrib.apps.drf_integration.form_elements.fields.file.fobi_integration_form_elements module
class fobi.contrib.apps.drf_integration.form_elements.fields.file.fobi_integration_form_elements.FileInputPlugin(user=None)[source]

Bases: fobi.base.IntegrationFormFieldPlugin, fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin

FileField plugin.

get_custom_field_instances(form_element_plugin, request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
integrate_with = 'drf_integration'
name = <django.utils.functional.__proxy__ object>
submit_plugin_form_data(form_element_plugin, form_entry, request, serializer, form_element_entries=None, **kwargs)[source]

Submit plugin form data.

Called on form submission (when user actually posts the data to assembled form).

Parameters:
  • form_element_plugin
  • form_entry (fobi.models.FormEntry) – Instance of fobi.models.FormEntry.
  • request (django.http.HttpRequest) –
  • serializer (rest_framework.serializers.Serializer) –
  • form_element_entries (iterable) –
uid = 'file'
Module contents
fobi.contrib.apps.drf_integration.form_elements.fields.float package
Submodules
fobi.contrib.apps.drf_integration.form_elements.fields.float.apps module
class fobi.contrib.apps.drf_integration.form_elements.fields.float.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

label = 'fobi_contrib_apps_drf_integration_form_elements_fields_float'
name = 'fobi.contrib.apps.drf_integration.form_elements.fields.float'
fobi.contrib.apps.drf_integration.form_elements.fields.float.base module
class fobi.contrib.apps.drf_integration.form_elements.fields.float.base.FloatInputPlugin(user=None)[source]

Bases: fobi.base.IntegrationFormFieldPlugin, fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin

FloatField plugin.

get_custom_field_instances(form_element_plugin, request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
integrate_with = 'drf_integration'
name = <django.utils.functional.__proxy__ object>
uid = 'float'
fobi.contrib.apps.drf_integration.form_elements.fields.float.fobi_integration_form_elements module
class fobi.contrib.apps.drf_integration.form_elements.fields.float.fobi_integration_form_elements.FloatInputPlugin(user=None)[source]

Bases: fobi.base.IntegrationFormFieldPlugin, fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin

FloatField plugin.

get_custom_field_instances(form_element_plugin, request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
integrate_with = 'drf_integration'
name = <django.utils.functional.__proxy__ object>
uid = 'float'
Module contents
fobi.contrib.apps.drf_integration.form_elements.fields.hidden package
Submodules
fobi.contrib.apps.drf_integration.form_elements.fields.hidden.apps module
class fobi.contrib.apps.drf_integration.form_elements.fields.hidden.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

label = 'fobi_contrib_apps_drf_integration_form_elements_fields_hidden'
name = 'fobi.contrib.apps.drf_integration.form_elements.fields.hidden'
fobi.contrib.apps.drf_integration.form_elements.fields.hidden.base module
class fobi.contrib.apps.drf_integration.form_elements.fields.hidden.base.HiddenInputPlugin(user=None)[source]

Bases: fobi.base.IntegrationFormFieldPlugin, fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin

CharField plugin.

get_custom_field_instances(form_element_plugin, request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
integrate_with = 'drf_integration'
name = <django.utils.functional.__proxy__ object>
uid = 'hidden'
fobi.contrib.apps.drf_integration.form_elements.fields.hidden.fobi_integration_form_elements module
class fobi.contrib.apps.drf_integration.form_elements.fields.hidden.fobi_integration_form_elements.HiddenInputPlugin(user=None)[source]

Bases: fobi.base.IntegrationFormFieldPlugin, fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin

CharField plugin.

get_custom_field_instances(form_element_plugin, request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
integrate_with = 'drf_integration'
name = <django.utils.functional.__proxy__ object>
uid = 'hidden'
Module contents
fobi.contrib.apps.drf_integration.form_elements.fields.input package
Submodules
fobi.contrib.apps.drf_integration.form_elements.fields.input.apps module
class fobi.contrib.apps.drf_integration.form_elements.fields.input.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

label = 'fobi_contrib_apps_drf_integration_form_elements_fields_input'
name = 'fobi.contrib.apps.drf_integration.form_elements.fields.input'
fobi.contrib.apps.drf_integration.form_elements.fields.input.base module
class fobi.contrib.apps.drf_integration.form_elements.fields.input.base.InputPlugin(user=None)[source]

Bases: fobi.base.IntegrationFormFieldPlugin, fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin

CharField plugin.

get_custom_field_instances(form_element_plugin, request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
integrate_with = 'drf_integration'
name = <django.utils.functional.__proxy__ object>
uid = 'input'
fobi.contrib.apps.drf_integration.form_elements.fields.input.fobi_integration_form_elements module
Module contents
fobi.contrib.apps.drf_integration.form_elements.fields.integer package
Submodules
fobi.contrib.apps.drf_integration.form_elements.fields.integer.apps module
class fobi.contrib.apps.drf_integration.form_elements.fields.integer.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

label = 'fobi_contrib_apps_drf_integration_form_elements_fields_integer'
name = 'fobi.contrib.apps.drf_integration.form_elements.fields.integer'
fobi.contrib.apps.drf_integration.form_elements.fields.integer.base module
class fobi.contrib.apps.drf_integration.form_elements.fields.integer.base.IntegerInputPlugin(user=None)[source]

Bases: fobi.base.IntegrationFormFieldPlugin, fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin

IntegerField plugin.

get_custom_field_instances(form_element_plugin, request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
integrate_with = 'drf_integration'
name = <django.utils.functional.__proxy__ object>
uid = 'integer'
fobi.contrib.apps.drf_integration.form_elements.fields.integer.fobi_integration_form_elements module
class fobi.contrib.apps.drf_integration.form_elements.fields.integer.fobi_integration_form_elements.IntegerInputPlugin(user=None)[source]

Bases: fobi.base.IntegrationFormFieldPlugin, fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin

IntegerField plugin.

get_custom_field_instances(form_element_plugin, request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
integrate_with = 'drf_integration'
name = <django.utils.functional.__proxy__ object>
uid = 'integer'
Module contents
fobi.contrib.apps.drf_integration.form_elements.fields.ip_address package
Submodules
fobi.contrib.apps.drf_integration.form_elements.fields.ip_address.apps module
class fobi.contrib.apps.drf_integration.form_elements.fields.ip_address.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

label = 'fobi_contrib_apps_drf_integration_form_elements_fields_ip_address'
name = 'fobi.contrib.apps.drf_integration.form_elements.fields.ip_address'
fobi.contrib.apps.drf_integration.form_elements.fields.ip_address.base module
class fobi.contrib.apps.drf_integration.form_elements.fields.ip_address.base.IPAddressInputPlugin(user=None)[source]

Bases: fobi.base.IntegrationFormFieldPlugin, fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin

IPAddressField plugin.

get_custom_field_instances(form_element_plugin, request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
integrate_with = 'drf_integration'
name = <django.utils.functional.__proxy__ object>
uid = 'ip_address'
fobi.contrib.apps.drf_integration.form_elements.fields.ip_address.fobi_integration_form_elements module
class fobi.contrib.apps.drf_integration.form_elements.fields.ip_address.fobi_integration_form_elements.IPAddressInputPlugin(user=None)[source]

Bases: fobi.base.IntegrationFormFieldPlugin, fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin

IPAddressField plugin.

get_custom_field_instances(form_element_plugin, request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
integrate_with = 'drf_integration'
name = <django.utils.functional.__proxy__ object>
uid = 'ip_address'
Module contents
fobi.contrib.apps.drf_integration.form_elements.fields.null_boolean package
Submodules
fobi.contrib.apps.drf_integration.form_elements.fields.null_boolean.apps module
class fobi.contrib.apps.drf_integration.form_elements.fields.null_boolean.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

label = 'fobi_contrib_apps_drf_integration_form_elements_fields_null_boolean'
name = 'fobi.contrib.apps.drf_integration.form_elements.fields.null_boolean'
fobi.contrib.apps.drf_integration.form_elements.fields.null_boolean.base module
class fobi.contrib.apps.drf_integration.form_elements.fields.null_boolean.base.NullBooleanSelectPlugin(user=None)[source]

Bases: fobi.base.IntegrationFormFieldPlugin, fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin

NullBooleanField select plugin.

get_custom_field_instances(form_element_plugin, request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
integrate_with = 'drf_integration'
name = <django.utils.functional.__proxy__ object>
uid = 'null_boolean'
fobi.contrib.apps.drf_integration.form_elements.fields.null_boolean.fobi_integration_form_elements module
class fobi.contrib.apps.drf_integration.form_elements.fields.null_boolean.fobi_integration_form_elements.NullBooleanSelectPlugin(user=None)[source]

Bases: fobi.base.IntegrationFormFieldPlugin, fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin

NullBooleanField select plugin.

get_custom_field_instances(form_element_plugin, request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
integrate_with = 'drf_integration'
name = <django.utils.functional.__proxy__ object>
uid = 'null_boolean'
Module contents
fobi.contrib.apps.drf_integration.form_elements.fields.password package
Submodules
fobi.contrib.apps.drf_integration.form_elements.fields.password.apps module
class fobi.contrib.apps.drf_integration.form_elements.fields.password.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

label = 'fobi_contrib_apps_drf_integration_form_elements_fields_password'
name = 'fobi.contrib.apps.drf_integration.form_elements.fields.password'
fobi.contrib.apps.drf_integration.form_elements.fields.password.base module
class fobi.contrib.apps.drf_integration.form_elements.fields.password.base.PasswordInputPlugin(user=None)[source]

Bases: fobi.base.IntegrationFormFieldPlugin, fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin

CharField plugin.

get_custom_field_instances(form_element_plugin, request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
integrate_with = 'drf_integration'
name = <django.utils.functional.__proxy__ object>
uid = 'password'
fobi.contrib.apps.drf_integration.form_elements.fields.password.fobi_integration_form_elements module
class fobi.contrib.apps.drf_integration.form_elements.fields.password.fobi_integration_form_elements.PasswordInputPlugin(user=None)[source]

Bases: fobi.base.IntegrationFormFieldPlugin, fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin

CharField plugin.

get_custom_field_instances(form_element_plugin, request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
integrate_with = 'drf_integration'
name = <django.utils.functional.__proxy__ object>
uid = 'password'
Module contents
fobi.contrib.apps.drf_integration.form_elements.fields.radio package
Submodules
fobi.contrib.apps.drf_integration.form_elements.fields.radio.apps module
class fobi.contrib.apps.drf_integration.form_elements.fields.radio.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

label = 'fobi_contrib_apps_drf_integration_form_elements_fields_radio'
name = 'fobi.contrib.apps.drf_integration.form_elements.fields.radio'
fobi.contrib.apps.drf_integration.form_elements.fields.radio.base module
class fobi.contrib.apps.drf_integration.form_elements.fields.radio.base.RadioInputPlugin(user=None)[source]

Bases: fobi.base.IntegrationFormFieldPlugin, fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin

ChoiceField plugin.

get_custom_field_instances(form_element_plugin, request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
integrate_with = 'drf_integration'
name = <django.utils.functional.__proxy__ object>
uid = 'radio'
fobi.contrib.apps.drf_integration.form_elements.fields.radio.fobi_integration_form_elements module
class fobi.contrib.apps.drf_integration.form_elements.fields.radio.fobi_integration_form_elements.RadioInputPlugin(user=None)[source]

Bases: fobi.base.IntegrationFormFieldPlugin, fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin

ChoiceField plugin.

get_custom_field_instances(form_element_plugin, request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
integrate_with = 'drf_integration'
name = <django.utils.functional.__proxy__ object>
uid = 'radio'
Module contents
fobi.contrib.apps.drf_integration.form_elements.fields.range_select package
Submodules
fobi.contrib.apps.drf_integration.form_elements.fields.range_select.apps module
class fobi.contrib.apps.drf_integration.form_elements.fields.range_select.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

label = 'fobi_contrib_apps_drf_integration_form_elements_fields_range_select'
name = 'fobi.contrib.apps.drf_integration.form_elements.fields.range_select'
fobi.contrib.apps.drf_integration.form_elements.fields.range_select.base module
class fobi.contrib.apps.drf_integration.form_elements.fields.range_select.base.RangeSelectInputPlugin(user=None)[source]

Bases: fobi.base.IntegrationFormFieldPlugin, fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin

ChoiceField plugin.

get_custom_field_instances(form_element_plugin, request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
integrate_with = 'drf_integration'
name = <django.utils.functional.__proxy__ object>
uid = 'range_select'
fobi.contrib.apps.drf_integration.form_elements.fields.range_select.fobi_integration_form_elements module
class fobi.contrib.apps.drf_integration.form_elements.fields.range_select.fobi_integration_form_elements.RangeSelectInputPlugin(user=None)[source]

Bases: fobi.base.IntegrationFormFieldPlugin, fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin

ChoiceField plugin.

get_custom_field_instances(form_element_plugin, request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
integrate_with = 'drf_integration'
name = <django.utils.functional.__proxy__ object>
uid = 'range_select'
Module contents
fobi.contrib.apps.drf_integration.form_elements.fields.regex package
Submodules
fobi.contrib.apps.drf_integration.form_elements.fields.regex.apps module
class fobi.contrib.apps.drf_integration.form_elements.fields.regex.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

label = 'fobi_contrib_apps_drf_integration_form_elements_fields_regex'
name = 'fobi.contrib.apps.drf_integration.form_elements.fields.regex'
fobi.contrib.apps.drf_integration.form_elements.fields.regex.base module
class fobi.contrib.apps.drf_integration.form_elements.fields.regex.base.RegexInputPlugin(user=None)[source]

Bases: fobi.base.IntegrationFormFieldPlugin, fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin

RegexField plugin.

get_custom_field_instances(form_element_plugin, request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
integrate_with = 'drf_integration'
name = <django.utils.functional.__proxy__ object>
uid = 'regex'
fobi.contrib.apps.drf_integration.form_elements.fields.regex.fobi_integration_form_elements module
class fobi.contrib.apps.drf_integration.form_elements.fields.regex.fobi_integration_form_elements.RegexInputPlugin(user=None)[source]

Bases: fobi.base.IntegrationFormFieldPlugin, fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin

RegexField plugin.

get_custom_field_instances(form_element_plugin, request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
integrate_with = 'drf_integration'
name = <django.utils.functional.__proxy__ object>
uid = 'regex'
Module contents
fobi.contrib.apps.drf_integration.form_elements.fields.select package
Submodules
fobi.contrib.apps.drf_integration.form_elements.fields.select.apps module
class fobi.contrib.apps.drf_integration.form_elements.fields.select.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

label = 'fobi_contrib_apps_drf_integration_form_elements_fields_select'
name = 'fobi.contrib.apps.drf_integration.form_elements.fields.select'
fobi.contrib.apps.drf_integration.form_elements.fields.select.base module
class fobi.contrib.apps.drf_integration.form_elements.fields.select.base.SelectInputPlugin(user=None)[source]

Bases: fobi.base.IntegrationFormFieldPlugin, fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin

ChoiceField plugin.

get_custom_field_instances(form_element_plugin, request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
integrate_with = 'drf_integration'
name = <django.utils.functional.__proxy__ object>
uid = 'select'
fobi.contrib.apps.drf_integration.form_elements.fields.select.fobi_integration_form_elements module
class fobi.contrib.apps.drf_integration.form_elements.fields.select.fobi_integration_form_elements.SelectInputPlugin(user=None)[source]

Bases: fobi.base.IntegrationFormFieldPlugin, fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin

ChoiceField plugin.

get_custom_field_instances(form_element_plugin, request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
integrate_with = 'drf_integration'
name = <django.utils.functional.__proxy__ object>
uid = 'select'
Module contents
fobi.contrib.apps.drf_integration.form_elements.fields.select_model_object package
Submodules
fobi.contrib.apps.drf_integration.form_elements.fields.select_model_object.apps module
class fobi.contrib.apps.drf_integration.form_elements.fields.select_model_object.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

label = 'fobi_contrib_apps_drf_integration_form_elements_fields_select_model_object'
name = 'fobi.contrib.apps.drf_integration.form_elements.fields.select_model_object'
fobi.contrib.apps.drf_integration.form_elements.fields.select_model_object.base module
class fobi.contrib.apps.drf_integration.form_elements.fields.select_model_object.base.SelectModelObjectInputPlugin(user=None)[source]

Bases: fobi.base.IntegrationFormFieldPlugin, fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin

ChoiceField plugin.

get_custom_field_instances(form_element_plugin, request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
integrate_with = 'drf_integration'
name = <django.utils.functional.__proxy__ object>
submit_plugin_form_data(form_element_plugin, form_entry, request, serializer, form_element_entries=None, **kwargs)[source]

Submit plugin form data.

Called on form submission (when user actually posts the data to assembled form).

Parameters:
  • form_element_plugin
  • form_entry (fobi.models.FormEntry) – Instance of fobi.models.FormEntry.
  • request (django.http.HttpRequest) –
  • serializer (rest_framework.serializers.Serializer) –
  • form_element_entries (iterable) –
uid = 'select_model_object'
fobi.contrib.apps.drf_integration.form_elements.fields.select_model_object.fobi_integration_form_elements module
class fobi.contrib.apps.drf_integration.form_elements.fields.select_model_object.fobi_integration_form_elements.SelectModelObjectInputPlugin(user=None)[source]

Bases: fobi.base.IntegrationFormFieldPlugin, fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin

ChoiceField plugin.

get_custom_field_instances(form_element_plugin, request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
integrate_with = 'drf_integration'
name = <django.utils.functional.__proxy__ object>
submit_plugin_form_data(form_element_plugin, form_entry, request, serializer, form_element_entries=None, **kwargs)[source]

Submit plugin form data.

Called on form submission (when user actually posts the data to assembled form).

Parameters:
  • form_element_plugin
  • form_entry (fobi.models.FormEntry) – Instance of fobi.models.FormEntry.
  • request (django.http.HttpRequest) –
  • serializer (rest_framework.serializers.Serializer) –
  • form_element_entries (iterable) –
uid = 'select_model_object'
Module contents
fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple package
Submodules
fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple.apps module
class fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

label = 'fobi_contrib_apps_drf_integration_form_elements_fields_select_multiple'
name = 'fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple'
fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple.base module
class fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple.base.SelectMultipleInputPlugin(user=None)[source]

Bases: fobi.base.IntegrationFormFieldPlugin, fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin

MultipleChoiceField plugin.

get_custom_field_instances(form_element_plugin, request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
integrate_with = 'drf_integration'
name = <django.utils.functional.__proxy__ object>
submit_plugin_form_data(form_element_plugin, form_entry, request, serializer, form_element_entries=None, **kwargs)[source]

Submit plugin form data.

Called on form submission (when user actually posts the data to assembled form).

Parameters:
  • form_element_plugin
  • form_entry (fobi.models.FormEntry) – Instance of fobi.models.FormEntry.
  • request (django.http.HttpRequest) –
  • serializer (rest_framework.serializers.Serializer) –
  • form_element_entries (iterable) –
uid = 'select_multiple'
fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple.fobi_integration_form_elements module
class fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple.fobi_integration_form_elements.SelectMultipleInputPlugin(user=None)[source]

Bases: fobi.base.IntegrationFormFieldPlugin, fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin

MultipleChoiceField plugin.

get_custom_field_instances(form_element_plugin, request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
integrate_with = 'drf_integration'
name = <django.utils.functional.__proxy__ object>
submit_plugin_form_data(form_element_plugin, form_entry, request, serializer, form_element_entries=None, **kwargs)[source]

Submit plugin form data.

Called on form submission (when user actually posts the data to assembled form).

Parameters:
  • form_element_plugin
  • form_entry (fobi.models.FormEntry) – Instance of fobi.models.FormEntry.
  • request (django.http.HttpRequest) –
  • serializer (rest_framework.serializers.Serializer) –
  • form_element_entries (iterable) –
uid = 'select_multiple'
Module contents
fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple_model_objects package
Submodules
fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple_model_objects.apps module
class fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple_model_objects.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

label = 'fobi_contrib_apps_drf_integration_form_elements_fields_select_multiple_model_objects'
name = 'fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple_model_objects'
fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple_model_objects.base module
class fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple_model_objects.base.SelectMultipleModelObjectsInputPlugin(user=None)[source]

Bases: fobi.base.IntegrationFormFieldPlugin, fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin

ModelMultipleChoiceField plugin.

get_custom_field_instances(form_element_plugin, request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
integrate_with = 'drf_integration'
name = <django.utils.functional.__proxy__ object>
submit_plugin_form_data(form_element_plugin, form_entry, request, serializer, form_element_entries=None, **kwargs)[source]

Submit plugin form data.

Called on form submission (when user actually posts the data to assembled form).

Parameters:
  • form_element_plugin
  • form_entry (fobi.models.FormEntry) – Instance of fobi.models.FormEntry.
  • request (django.http.HttpRequest) –
  • serializer (rest_framework.serializers.Serializer) –
  • form_element_entries (iterable) –
uid = 'select_multiple_model_objects'
fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple_model_objects.fobi_integration_form_elements module
class fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple_model_objects.fobi_integration_form_elements.SelectMultipleModelObjectsInputPlugin(user=None)[source]

Bases: fobi.base.IntegrationFormFieldPlugin, fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin

ModelMultipleChoiceField plugin.

get_custom_field_instances(form_element_plugin, request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
integrate_with = 'drf_integration'
name = <django.utils.functional.__proxy__ object>
submit_plugin_form_data(form_element_plugin, form_entry, request, serializer, form_element_entries=None, **kwargs)[source]

Submit plugin form data.

Called on form submission (when user actually posts the data to assembled form).

Parameters:
  • form_element_plugin
  • form_entry (fobi.models.FormEntry) – Instance of fobi.models.FormEntry.
  • request (django.http.HttpRequest) –
  • serializer (rest_framework.serializers.Serializer) –
  • form_element_entries (iterable) –
uid = 'select_multiple_model_objects'
Module contents
fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple_with_max package
Submodules
fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple_with_max.apps module
class fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple_with_max.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

label = 'fobi_contrib_apps_drf_integration_form_elements_fields_select_multiple_with_max'
name = 'fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple_with_max'
fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple_with_max.base module
class fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple_with_max.base.SelectMultipleWithMaxInputPlugin(user=None)[source]

Bases: fobi.base.IntegrationFormFieldPlugin, fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin

MultipleChoiceField with max plugin.

get_custom_field_instances(form_element_plugin, request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
integrate_with = 'drf_integration'
name = <django.utils.functional.__proxy__ object>
submit_plugin_form_data(form_element_plugin, form_entry, request, serializer, form_element_entries=None, **kwargs)[source]

Submit plugin form data.

Called on form submission (when user actually posts the data to assembled form).

Parameters:
  • form_element_plugin
  • form_entry (fobi.models.FormEntry) – Instance of fobi.models.FormEntry.
  • request (django.http.HttpRequest) –
  • serializer (rest_framework.serializers.Serializer) –
  • form_element_entries (iterable) –
uid = 'select_multiple_with_max'
fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple_with_max.fobi_integration_form_elements module
class fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple_with_max.fobi_integration_form_elements.SelectMultipleWithMaxInputPlugin(user=None)[source]

Bases: fobi.base.IntegrationFormFieldPlugin, fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin

MultipleChoiceField with max plugin.

get_custom_field_instances(form_element_plugin, request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
integrate_with = 'drf_integration'
name = <django.utils.functional.__proxy__ object>
submit_plugin_form_data(form_element_plugin, form_entry, request, serializer, form_element_entries=None, **kwargs)[source]

Submit plugin form data.

Called on form submission (when user actually posts the data to assembled form).

Parameters:
  • form_element_plugin
  • form_entry (fobi.models.FormEntry) – Instance of fobi.models.FormEntry.
  • request (django.http.HttpRequest) –
  • serializer (rest_framework.serializers.Serializer) –
  • form_element_entries (iterable) –
uid = 'select_multiple_with_max'
Module contents
fobi.contrib.apps.drf_integration.form_elements.fields.slider package
Submodules
fobi.contrib.apps.drf_integration.form_elements.fields.slider.apps module
class fobi.contrib.apps.drf_integration.form_elements.fields.slider.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

label = 'fobi_contrib_apps_drf_integration_form_elements_fields_slider'
name = 'fobi.contrib.apps.drf_integration.form_elements.fields.slider'
fobi.contrib.apps.drf_integration.form_elements.fields.slider.base module
class fobi.contrib.apps.drf_integration.form_elements.fields.slider.base.SliderInputPlugin(user=None)[source]

Bases: fobi.base.IntegrationFormFieldPlugin, fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin

ChoiceField plugin.

get_custom_field_instances(form_element_plugin, request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
integrate_with = 'drf_integration'
name = <django.utils.functional.__proxy__ object>
uid = 'slider'
fobi.contrib.apps.drf_integration.form_elements.fields.slider.fobi_integration_form_elements module
class fobi.contrib.apps.drf_integration.form_elements.fields.slider.fobi_integration_form_elements.SliderInputPlugin(user=None)[source]

Bases: fobi.base.IntegrationFormFieldPlugin, fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin

ChoiceField plugin.

get_custom_field_instances(form_element_plugin, request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
integrate_with = 'drf_integration'
name = <django.utils.functional.__proxy__ object>
uid = 'slider'
Module contents
fobi.contrib.apps.drf_integration.form_elements.fields.slug package
Submodules
fobi.contrib.apps.drf_integration.form_elements.fields.slug.apps module
class fobi.contrib.apps.drf_integration.form_elements.fields.slug.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

label = 'fobi_contrib_apps_drf_integration_form_elements_fields_slug'
name = 'fobi.contrib.apps.drf_integration.form_elements.fields.slug'
fobi.contrib.apps.drf_integration.form_elements.fields.slug.base module
class fobi.contrib.apps.drf_integration.form_elements.fields.slug.base.SlugInputPlugin(user=None)[source]

Bases: fobi.base.IntegrationFormFieldPlugin, fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin

SlugField plugin.

get_custom_field_instances(form_element_plugin, request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
integrate_with = 'drf_integration'
name = <django.utils.functional.__proxy__ object>
uid = 'slug'
fobi.contrib.apps.drf_integration.form_elements.fields.slug.fobi_integration_form_elements module
class fobi.contrib.apps.drf_integration.form_elements.fields.slug.fobi_integration_form_elements.SlugInputPlugin(user=None)[source]

Bases: fobi.base.IntegrationFormFieldPlugin, fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin

SlugField plugin.

get_custom_field_instances(form_element_plugin, request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
integrate_with = 'drf_integration'
name = <django.utils.functional.__proxy__ object>
uid = 'slug'
Module contents
fobi.contrib.apps.drf_integration.form_elements.fields.text package
Submodules
fobi.contrib.apps.drf_integration.form_elements.fields.text.apps module
class fobi.contrib.apps.drf_integration.form_elements.fields.text.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

label = 'fobi_contrib_apps_drf_integration_form_elements_fields_text'
name = 'fobi.contrib.apps.drf_integration.form_elements.fields.text'
fobi.contrib.apps.drf_integration.form_elements.fields.text.base module
class fobi.contrib.apps.drf_integration.form_elements.fields.text.base.TextInputPlugin(user=None)[source]

Bases: fobi.base.IntegrationFormFieldPlugin, fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin

CharField plugin.

get_custom_field_instances(form_element_plugin, request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
integrate_with = 'drf_integration'
name = <django.utils.functional.__proxy__ object>
uid = 'text'
fobi.contrib.apps.drf_integration.form_elements.fields.text.fobi_integration_form_elements module
class fobi.contrib.apps.drf_integration.form_elements.fields.text.fobi_integration_form_elements.TextInputPlugin(user=None)[source]

Bases: fobi.base.IntegrationFormFieldPlugin, fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin

CharField plugin.

get_custom_field_instances(form_element_plugin, request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
integrate_with = 'drf_integration'
name = <django.utils.functional.__proxy__ object>
uid = 'text'
Module contents
fobi.contrib.apps.drf_integration.form_elements.fields.textarea package
Submodules
fobi.contrib.apps.drf_integration.form_elements.fields.textarea.apps module
class fobi.contrib.apps.drf_integration.form_elements.fields.textarea.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

label = 'fobi_contrib_apps_drf_integration_form_elements_fields_textarea'
name = 'fobi.contrib.apps.drf_integration.form_elements.fields.textarea'
fobi.contrib.apps.drf_integration.form_elements.fields.textarea.base module
class fobi.contrib.apps.drf_integration.form_elements.fields.textarea.base.TextareaPlugin(user=None)[source]

Bases: fobi.base.IntegrationFormFieldPlugin, fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin

CharField plugin.

get_custom_field_instances(form_element_plugin, request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
integrate_with = 'drf_integration'
name = <django.utils.functional.__proxy__ object>
uid = 'textarea'
fobi.contrib.apps.drf_integration.form_elements.fields.textarea.fobi_integration_form_elements module
class fobi.contrib.apps.drf_integration.form_elements.fields.textarea.fobi_integration_form_elements.TextareaPlugin(user=None)[source]

Bases: fobi.base.IntegrationFormFieldPlugin, fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin

CharField plugin.

get_custom_field_instances(form_element_plugin, request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
integrate_with = 'drf_integration'
name = <django.utils.functional.__proxy__ object>
uid = 'textarea'
Module contents
fobi.contrib.apps.drf_integration.form_elements.fields.time package
Submodules
fobi.contrib.apps.drf_integration.form_elements.fields.time.apps module
class fobi.contrib.apps.drf_integration.form_elements.fields.time.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

label = 'fobi_contrib_apps_drf_integration_form_elements_fields_time'
name = 'fobi.contrib.apps.drf_integration.form_elements.fields.time'
fobi.contrib.apps.drf_integration.form_elements.fields.time.base module
class fobi.contrib.apps.drf_integration.form_elements.fields.time.base.TimeInputPlugin(user=None)[source]

Bases: fobi.base.IntegrationFormFieldPlugin, fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin

TimeField plugin.

get_custom_field_instances(form_element_plugin, request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
integrate_with = 'drf_integration'
name = <django.utils.functional.__proxy__ object>
uid = 'time'
fobi.contrib.apps.drf_integration.form_elements.fields.time.fobi_integration_form_elements module
class fobi.contrib.apps.drf_integration.form_elements.fields.time.fobi_integration_form_elements.TimeInputPlugin(user=None)[source]

Bases: fobi.base.IntegrationFormFieldPlugin, fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin

TimeField plugin.

get_custom_field_instances(form_element_plugin, request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
integrate_with = 'drf_integration'
name = <django.utils.functional.__proxy__ object>
uid = 'time'
Module contents
fobi.contrib.apps.drf_integration.form_elements.fields.url package
Submodules
fobi.contrib.apps.drf_integration.form_elements.fields.url.apps module
class fobi.contrib.apps.drf_integration.form_elements.fields.url.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

label = 'fobi_contrib_apps_drf_integration_form_elements_fields_url'
name = 'fobi.contrib.apps.drf_integration.form_elements.fields.url'
fobi.contrib.apps.drf_integration.form_elements.fields.url.base module
class fobi.contrib.apps.drf_integration.form_elements.fields.url.base.URLInputPlugin(user=None)[source]

Bases: fobi.base.IntegrationFormFieldPlugin, fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin

URLField plugin.

get_custom_field_instances(form_element_plugin, request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
integrate_with = 'drf_integration'
name = <django.utils.functional.__proxy__ object>
uid = 'url'
fobi.contrib.apps.drf_integration.form_elements.fields.url.fobi_integration_form_elements module
class fobi.contrib.apps.drf_integration.form_elements.fields.url.fobi_integration_form_elements.URLInputPlugin(user=None)[source]

Bases: fobi.base.IntegrationFormFieldPlugin, fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin

URLField plugin.

get_custom_field_instances(form_element_plugin, request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
integrate_with = 'drf_integration'
name = <django.utils.functional.__proxy__ object>
uid = 'url'
Module contents
Module contents
Module contents
fobi.contrib.apps.drf_integration.form_handlers package
Subpackages
fobi.contrib.apps.drf_integration.form_handlers.db_store package
Submodules
fobi.contrib.apps.drf_integration.form_handlers.db_store.apps module
class fobi.contrib.apps.drf_integration.form_handlers.db_store.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

Config.

label = 'fobi_contrib_apps_drf_integration_form_handlers_db_store'
name = 'fobi.contrib.apps.drf_integration.form_handlers.db_store'
fobi.contrib.apps.drf_integration.form_handlers.db_store.base module
class fobi.contrib.apps.drf_integration.form_handlers.db_store.base.DBStoreHandlerPlugin(user=None)[source]

Bases: fobi.base.IntegrationFormHandlerPlugin

DB store form handler plugin.

Can be used only once per form.

integrate_with = 'drf_integration'
name = <django.utils.functional.__proxy__ object>
run(form_handler_plugin, form_entry, request, form_element_entries=None, **kwargs)[source]

Run.

uid = 'db_store'
fobi.contrib.apps.drf_integration.form_handlers.db_store.fobi_integration_form_handlers module
class fobi.contrib.apps.drf_integration.form_handlers.db_store.fobi_integration_form_handlers.DBStoreHandlerPlugin(user=None)[source]

Bases: fobi.base.IntegrationFormHandlerPlugin

DB store form handler plugin.

Can be used only once per form.

integrate_with = 'drf_integration'
name = <django.utils.functional.__proxy__ object>
run(form_handler_plugin, form_entry, request, form_element_entries=None, **kwargs)[source]

Run.

uid = 'db_store'
Module contents
fobi.contrib.apps.drf_integration.form_handlers.http_repost package
Submodules
fobi.contrib.apps.drf_integration.form_handlers.http_repost.apps module
class fobi.contrib.apps.drf_integration.form_handlers.http_repost.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

Config.

label = 'fobi_contrib_apps_drf_integration_form_handlers_http_repost'
name = 'fobi.contrib.apps.drf_integration.form_handlers.http_repost'
fobi.contrib.apps.drf_integration.form_handlers.http_repost.base module
class fobi.contrib.apps.drf_integration.form_handlers.http_repost.base.HTTPRepostHandlerPlugin(user=None)[source]

Bases: fobi.base.IntegrationFormHandlerPlugin

HTTP re-post handler plugin.

integrate_with = 'drf_integration'
name = <django.utils.functional.__proxy__ object>
run(form_handler_plugin, form_entry, request, form_element_entries=None, **kwargs)[source]

Run.

uid = 'http_repost'
fobi.contrib.apps.drf_integration.form_handlers.http_repost.fobi_integration_form_handlers module
class fobi.contrib.apps.drf_integration.form_handlers.http_repost.fobi_integration_form_handlers.HTTPRepostHandlerPlugin(user=None)[source]

Bases: fobi.base.IntegrationFormHandlerPlugin

HTTP re-post handler plugin.

integrate_with = 'drf_integration'
name = <django.utils.functional.__proxy__ object>
run(form_handler_plugin, form_entry, request, form_element_entries=None, **kwargs)[source]

Run.

uid = 'http_repost'
Module contents
fobi.contrib.apps.drf_integration.form_handlers.mail package
Submodules
fobi.contrib.apps.drf_integration.form_handlers.mail.apps module
class fobi.contrib.apps.drf_integration.form_handlers.mail.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

Config.

label = 'fobi_contrib_apps_drf_integration_form_handlers_mail'
name = 'fobi.contrib.apps.drf_integration.form_handlers.mail'
fobi.contrib.apps.drf_integration.form_handlers.mail.base module
class fobi.contrib.apps.drf_integration.form_handlers.mail.base.MailHandlerPlugin(user=None)[source]

Bases: fobi.base.IntegrationFormHandlerPlugin

Mail handler form handler plugin.

Can be used only once per form.

integrate_with = 'drf_integration'
name = <django.utils.functional.__proxy__ object>
run(form_handler_plugin, form_entry, request, form_element_entries=None, **kwargs)[source]

Run.

uid = 'mail'
fobi.contrib.apps.drf_integration.form_handlers.mail.fobi_integration_form_handlers module
class fobi.contrib.apps.drf_integration.form_handlers.mail.fobi_integration_form_handlers.MailHandlerPlugin(user=None)[source]

Bases: fobi.base.IntegrationFormHandlerPlugin

Mail handler form handler plugin.

Can be used only once per form.

integrate_with = 'drf_integration'
name = <django.utils.functional.__proxy__ object>
run(form_handler_plugin, form_entry, request, form_element_entries=None, **kwargs)[source]

Run.

uid = 'mail'
Module contents
Module contents
Submodules
fobi.contrib.apps.drf_integration.apps module
class fobi.contrib.apps.drf_integration.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

label = 'fobi_contrib_apps_drf_integration'
name = 'fobi.contrib.apps.drf_integration'
fobi.contrib.apps.drf_integration.base module
class fobi.contrib.apps.drf_integration.base.DRFIntegrationFormElementPluginProcessor(*args, **kwargs)[source]

Bases: fobi.base.IntegrationFormElementPluginProcessor

Django REST framework field instance processor.

process_custom_form_field_instance(form_element_entry, form_entry, request, form_element_plugin=None)[source]

Process.

class fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin[source]

Bases: object

Submit plugin form data mixin.

submit_plugin_form_data(form_element_plugin, form_entry, request, serializer, form_element_entries=None, **kwargs)[source]

Submit plugin form data.

Called on form submission (when user actually posts the data to assembled form).

Parameters:
  • form_element_plugin
  • form_entry (fobi.models.FormEntry) – Instance of fobi.models.FormEntry.
  • request (django.http.HttpRequest) –
  • serializer (rest_framework.serializers.Serializer) –
  • form_element_entries (iterable) –
fobi.contrib.apps.drf_integration.base.get_cleaned_data(serializer, keys_to_remove=[], values_to_remove=[])[source]

Get cleaned data.

Gets cleaned data, having the trash (fields without values) filtered out.

Parameters:
  • serializer
  • keys_to_remove (iterable) –
  • values_to_remove (iterable) –
Return dict:
fobi.contrib.apps.drf_integration.base.get_field_name_to_label_map(serializer, keys_to_remove=[], values_to_remove=[])[source]

Get field name to label map.

Parameters:
  • serializer
  • keys_to_remove (iterable) –
  • values_to_remove (iterable) –
Return dict:
fobi.contrib.apps.drf_integration.base.get_processed_serializer_data(serializer, form_element_entries)[source]

Gets processed serializer data.

Simply fires both fobi.base.get_cleaned_data and fobi.base.get_field_name_to_label_map functions and returns the result.

Parameters:
  • serializer
  • form_element_entries (iterable) – Iterable of form element entries.
Return tuple:
fobi.contrib.apps.drf_integration.base.run_form_handlers(form_entry, request, serializer, form_element_entries=None)[source]

Run form handlers.

Parameters:
  • form_entry (fobi.models.FormEntry) –
  • request (django.http.HttpRequest) –
  • serializer (rest_framework.serializers.Serializer) –
  • form_element_entries (iterable) –
Return tuple:

List of success responses, list of error responses

fobi.contrib.apps.drf_integration.base.submit_plugin_form_data(form_entry, request, serializer, form_element_entries=None, **kwargs)[source]

Submit plugin form data for all plugins.

Parameters:
  • form_entry (fobi.models.FormEntry) – Instance of fobi.models.FormEntry.
  • request (django.http.HttpRequest) –
  • serializer (rest_framework.serializers.Serializer) –
  • form_element_entries (iterable) –
fobi.contrib.apps.drf_integration.dynamic module
fobi.contrib.apps.drf_integration.dynamic.assemble_serializer_class(form_entry, request=None, origin=None, origin_kwargs_update_func=None, origin_return_func=None, form_element_entries=None, has_value=None, declared_fields=None, declared_fields_metadata=None)[source]

Assemble a serializer class by given entry.

Parameters:
  • form_entry
  • base_class
  • request (django.http.HttpRequest) –
  • origin (string) –
  • origin_kwargs_update_func (callable) –
  • origin_return_func (callable) –
  • form_element_entries (iterable) – If given, used instead of form_entry.formelemententry_set.all (no additional database hit).
  • has_value (bool) –
fobi.contrib.apps.drf_integration.dynamic.get_declared_fields(form_entry, request=None, origin=None, origin_kwargs_update_func=None, origin_return_func=None, form_element_entries=None, has_value=None)[source]

Get declared fields.

fobi.contrib.apps.drf_integration.fields module
class fobi.contrib.apps.drf_integration.fields.ContentImageField(**kwargs)[source]

Bases: fobi.contrib.apps.drf_integration.fields.NoneField

Content image field.

class fobi.contrib.apps.drf_integration.fields.ContentTextField(**kwargs)[source]

Bases: fobi.contrib.apps.drf_integration.fields.NoneField

Content text field.

class fobi.contrib.apps.drf_integration.fields.ContentVideoField(**kwargs)[source]

Bases: fobi.contrib.apps.drf_integration.fields.NoneField

Content video field.

class fobi.contrib.apps.drf_integration.fields.ModelChoiceField(*args, **kwargs)[source]

Bases: rest_framework.fields.ChoiceField, fobi.contrib.apps.drf_integration.fields.ModelChoiceFieldMixin

Model choice field.

class fobi.contrib.apps.drf_integration.fields.ModelMultipleChoiceField(*args, **kwargs)[source]

Bases: rest_framework.fields.MultipleChoiceField, fobi.contrib.apps.drf_integration.fields.ModelChoiceFieldMixin

Model choice field.

class fobi.contrib.apps.drf_integration.fields.MultipleChoiceWithMaxField(*args, **kwargs)[source]

Bases: rest_framework.fields.MultipleChoiceField

MultipleChoiceWithMaxField.

default_error_messages = {u'not_a_list': <django.utils.functional.__proxy__ object at 0x7f6c0e081650>, 'max_choices': <django.utils.functional.__proxy__ object at 0x7f6c0e0a90d0>, u'invalid_choice': <django.utils.functional.__proxy__ object at 0x7f6c0e0815d0>, u'empty': <django.utils.functional.__proxy__ object at 0x7f6c0e0816d0>}
to_internal_value(data)[source]
class fobi.contrib.apps.drf_integration.fields.NoneField(**kwargs)[source]

Bases: rest_framework.fields.Field

NoneField.

default_empty_html = ''
default_error_messages = {}
initial = ''
run_validation(data=<class rest_framework.fields.empty>)[source]
to_internal_value(data)[source]
to_representation(value)[source]
fobi.contrib.apps.drf_integration.helpers module
fobi.contrib.apps.drf_integration.helpers.map_field_name_to_label(serializer)[source]

Takes a form and creates label to field name map.

Parameters:serializer – Instance of rest_framework.serializers.Serializer.
Return dict:
fobi.contrib.apps.drf_integration.metadata module
class fobi.contrib.apps.drf_integration.metadata.FobiMetaData[source]

Bases: rest_framework.metadata.SimpleMetadata

Meta data for better representation of the form elements.

get_field_info(field)[source]

Get field info.

Given an instance of a serializer field, return a dictionary of metadata about it.

label_lookup = <rest_framework.utils.field_mapping.ClassLookupDict object>
fobi.contrib.apps.drf_integration.serializers module
class fobi.contrib.apps.drf_integration.serializers.FormEntrySerializer(instance=None, data=<class rest_framework.fields.empty>, **kwargs)[source]

Bases: rest_framework.serializers.ModelSerializer

FormEntry serializer (read-only).

Used for detail and list views.

class Meta[source]

Bases: object

Options.

fields = ('url', 'id', 'slug', 'title')
model

alias of FormEntry

read_only_fields = ('url', 'id', 'slug', 'title')
FormEntrySerializer.get_fields_metadata(field_name=None)[source]

Just to make sure nothing breaks.

FormEntrySerializer.get_url(obj)[source]

Get URL.

fobi.contrib.apps.drf_integration.urls module
fobi.contrib.apps.drf_integration.utils module
fobi.contrib.apps.drf_integration.utils.get_serializer_class(form_entry, request=None, has_value=None, declared_fields=None)[source]

Get assembled serializer class.

Parameters:
  • form_entry (fobi.models.FormEntry) –
  • request (django.http.HttpRequest) –
  • has_value (bool) –
  • declared_fields (list) –
Return django.forms.Form:
 
fobi.contrib.apps.drf_integration.views module
class fobi.contrib.apps.drf_integration.views.FobiFormEntryViewSet(**kwargs)[source]

Bases: rest_framework.mixins.RetrieveModelMixin, rest_framework.mixins.UpdateModelMixin, rest_framework.mixins.ListModelMixin, rest_framework.viewsets.GenericViewSet

FormEntry view set.

get_object()[source]

Override get_object to get things done.

get_queryset()[source]

Get queryset.

We show all forms to authenticated users and show only public forms to non-authenticated users.

get_serializer(*args, **kwargs)[source]

Get the serializer.

get_serializer_class()[source]

Get serializer class.

has_value()[source]
lookup_field = 'slug'
lookup_url_kwarg = 'slug'
metadata_class

alias of FobiMetaData

permission_classes = [<class 'rest_framework.permissions.AllowAny'>]
queryset
suffix = None
update(request, *args, **kwargs)[source]
Module contents
fobi.contrib.apps.feincms_integration package
Submodules
fobi.contrib.apps.feincms_integration.apps module
class fobi.contrib.apps.feincms_integration.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

Config.

label = 'fobi_contrib_apps_feincms_integration'
name = 'fobi.contrib.apps.feincms_integration'
fobi.contrib.apps.feincms_integration.conf module
fobi.contrib.apps.feincms_integration.conf.get_setting(setting, override=None)[source]

Get setting.

Get a setting from fobi.contrib.apps.feincms_integration conf module, falling back to the default.

If override is not None, it will be used instead of the setting.

Parameters:
  • setting – String with setting name
  • override – Value to use when no setting is available. Defaults to None.
Returns:

Setting value.

fobi.contrib.apps.feincms_integration.defaults module
fobi.contrib.apps.feincms_integration.helpers module
fobi.contrib.apps.feincms_integration.helpers.get_form_template_choices()[source]

Gets the form template choices.

It’s possible to provide theme templates per theme or just per project.

Return list:
fobi.contrib.apps.feincms_integration.helpers.get_success_page_template_choices()[source]

Get success page template choices.

Return list:
fobi.contrib.apps.feincms_integration.settings module
  • WIDGET_FORM_SENT_GET_PARAM (str): Name of the GET param indicating that form has been successfully sent.
fobi.contrib.apps.feincms_integration.widgets module
class fobi.contrib.apps.feincms_integration.widgets.FobiFormWidget(*args, **kwargs)[source]

Bases: django.db.models.base.Model, fobi.integration.processors.IntegrationProcessor

Widget for to FeinCMS.

Property fobi.models.FormEntry form_entry:
 Form entry to be rendered.
Property str template:
 If given used for rendering the form.
class Meta[source]

Meta class.

abstract = False
app_label = 'fobi'
FobiFormWidget.can_redirect = True
FobiFormWidget.finalize(request, response)[source]

Finalize.

FobiFormWidget.form_entry

Accessor to the related object on the forward side of a many-to-one or one-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

child.parent is a ForwardManyToOneDescriptor instance.

FobiFormWidget.form_entry_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

FobiFormWidget.form_sent_get_param = 'sent'
FobiFormWidget.form_submit_button_text

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

FobiFormWidget.form_template_name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

FobiFormWidget.form_title

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

FobiFormWidget.get_form_template_name_display(*moreargs, **morekwargs)
FobiFormWidget.get_success_page_template_name_display(*moreargs, **morekwargs)
FobiFormWidget.hide_form_title

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

FobiFormWidget.hide_success_page_title

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

FobiFormWidget.process(request, **kwargs)[source]

This is where most of the form handling happens.

Parameters:request (django.http.HttpRequest) –
Return django.http.HttpResponse | str:
 
FobiFormWidget.render(**kwargs)[source]

Render.

FobiFormWidget.success_page_template_name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

FobiFormWidget.success_page_text

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

FobiFormWidget.success_page_title

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

Module contents
fobi.contrib.apps.mezzanine_integration package
Submodules
fobi.contrib.apps.mezzanine_integration.admin module
fobi.contrib.apps.mezzanine_integration.apps module
class fobi.contrib.apps.mezzanine_integration.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

Config.

label = 'fobi_contrib_apps_mezzanine_integration'
name = 'fobi.contrib.apps.mezzanine_integration'
fobi.contrib.apps.mezzanine_integration.conf module
fobi.contrib.apps.mezzanine_integration.conf.get_setting(setting, override=None)[source]

Get setting.

Get a setting from fobi.contrib.apps.mezzanine_integration conf module, falling back to the default.

If override is not None, it will be used instead of the setting.

Parameters:
  • setting – String with setting name
  • override – Value to use when no setting is available. Defaults to None.
Returns:

Setting value.

fobi.contrib.apps.mezzanine_integration.defaults module
fobi.contrib.apps.mezzanine_integration.helpers module
fobi.contrib.apps.mezzanine_integration.helpers.get_form_template_choices()[source]

Gets the form template choices.

It’s possible to provide theme templates per theme or just per project.

Return list:
fobi.contrib.apps.mezzanine_integration.helpers.get_success_page_template_choices()[source]

Get success page template choices.

Return list:
fobi.contrib.apps.mezzanine_integration.models module
fobi.contrib.apps.mezzanine_integration.page_processors module
fobi.contrib.apps.mezzanine_integration.settings module
  • WIDGET_FORM_SENT_GET_PARAM (str): Name of the GET param indicating that form has been successfully sent.
Module contents
Module contents
fobi.contrib.plugins package
Subpackages
fobi.contrib.plugins.form_elements package
Subpackages
fobi.contrib.plugins.form_elements.content package
Subpackages
fobi.contrib.plugins.form_elements.content.content_image package
Submodules
fobi.contrib.plugins.form_elements.content.content_image.apps module
class fobi.contrib.plugins.form_elements.content.content_image.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

Config.

label = 'fobi_contrib_plugins_form_elements_content_content_image'
name = 'fobi.contrib.plugins.form_elements.content.content_image'
fobi.contrib.plugins.form_elements.content.content_image.base module
class fobi.contrib.plugins.form_elements.content.content_image.base.ContentImagePlugin(user=None)[source]

Bases: fobi.base.FormElementPlugin

Content image plugin.

clone_plugin_data(entry)[source]

Clone plugin data.

Clone plugin data, which means we make a copy of the original image.

TODO: Perhaps rely more on data of form_element_entry?

delete_plugin_data()[source]

Delete uploaded file.

form

alias of ContentImageForm

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

get_raw_data()[source]

Get raw data.

Might be used in integration plugins.

get_rendered_image()[source]

Get rendered image.

group = <django.utils.functional.__proxy__ object>
name = <django.utils.functional.__proxy__ object>
post_processor()[source]

Post process data.

Always the same.

uid = 'content_image'
fobi.contrib.plugins.form_elements.content.content_image.conf module
fobi.contrib.plugins.form_elements.content.content_image.conf.get_setting(setting, override=None)[source]

Get setting.

Get a setting from fobi.contrib.plugins.form_elements.content.content_image conf module, falling back to the default.

If override is not None, it will be used instead of the setting.

Parameters:
  • setting – String with setting name
  • override – Value to use when no setting is available. Defaults to None.
Returns:

Setting value.

fobi.contrib.plugins.form_elements.content.content_image.defaults module
fobi.contrib.plugins.form_elements.content.content_image.fobi_form_elements module
class fobi.contrib.plugins.form_elements.content.content_image.fobi_form_elements.ContentImagePlugin(user=None)[source]

Bases: fobi.base.FormElementPlugin

Content image plugin.

clone_plugin_data(entry)[source]

Clone plugin data.

Clone plugin data, which means we make a copy of the original image.

TODO: Perhaps rely more on data of form_element_entry?

delete_plugin_data()[source]

Delete uploaded file.

form

alias of ContentImageForm

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

get_raw_data()[source]

Get raw data.

Might be used in integration plugins.

get_rendered_image()[source]

Get rendered image.

group = <django.utils.functional.__proxy__ object>
name = <django.utils.functional.__proxy__ object>
post_processor()[source]

Post process data.

Always the same.

uid = 'content_image'
fobi.contrib.plugins.form_elements.content.content_image.forms module
class fobi.contrib.plugins.form_elements.content.content_image.forms.ContentImageForm(data=None, files=None, auto_id=u'id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None)[source]

Bases: django.forms.forms.Form, fobi.base.BasePluginForm

Form for ContentImagePlugin.

base_fields = OrderedDict([('file', <django.forms.fields.ImageField object at 0x7f6c0e0514d0>), ('alt', <django.forms.fields.CharField object at 0x7f6c0e051510>), ('fit_method', <django.forms.fields.ChoiceField object at 0x7f6c0e0515d0>), ('size', <django.forms.fields.ChoiceField object at 0x7f6c0e051690>)])
declared_fields = OrderedDict([('file', <django.forms.fields.ImageField object at 0x7f6c0e0514d0>), ('alt', <django.forms.fields.CharField object at 0x7f6c0e051510>), ('fit_method', <django.forms.fields.ChoiceField object at 0x7f6c0e0515d0>), ('size', <django.forms.fields.ChoiceField object at 0x7f6c0e051690>)])
media
plugin_data_fields = [('file', ''), ('alt', ''), ('fit_method', 'center'), ('size', '500x500')]
save_plugin_data(request=None)[source]

Saving the plugin data and moving the file.

fobi.contrib.plugins.form_elements.content.content_image.helpers module
fobi.contrib.plugins.form_elements.content.content_image.helpers.clone_file(source_filename, relative_path=True)[source]

Clone the file.

Parameters:source_filename (string) – Source filename.
Return string:Filename of the cloned file.
fobi.contrib.plugins.form_elements.content.content_image.helpers.delete_file(image_file)[source]

Delete file from disc.

fobi.contrib.plugins.form_elements.content.content_image.helpers.ensure_unique_filename(destination)[source]

Makes sure filenames are never overwritten.

Parameters:destination (string) –
Return string:
fobi.contrib.plugins.form_elements.content.content_image.helpers.get_crop_filter(fit_method)[source]

Get crop filter.

fobi.contrib.plugins.form_elements.content.content_image.helpers.handle_uploaded_file(image_file)[source]

Handle uploaded file.

Parameters:image_file (django.core.files.uploadedfile.InMemoryUploadedFile) –
Return string:Path to the image (relative).
fobi.contrib.plugins.form_elements.content.content_image.settings module
  • FIT_METHOD_CROP_SMART (string)
  • FIT_METHOD_CROP_CENTER (string)
  • FIT_METHOD_CROP_SCALE (string)
  • FIT_METHOD_FIT_WIDTH (string)
  • FIT_METHOD_FIT_HEIGHT (string)
  • DEFAULT_FIT_METHOD (string)
  • FIT_METHODS_CHOICES (tuple)
  • FIT_METHODS_CHOICES_WITH_EMPTY_OPTION (list)
  • IMAGES_UPLOAD_DIR (string)
Module contents
fobi.contrib.plugins.form_elements.content.content_image_url package
Submodules
fobi.contrib.plugins.form_elements.content.content_image_url.apps module
class fobi.contrib.plugins.form_elements.content.content_image_url.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

Config.

label = 'fobi_contrib_plugins_form_elements_content_content_image_url'
name = 'fobi.contrib.plugins.form_elements.content.content_image_url'
fobi.contrib.plugins.form_elements.content.content_image_url.base module
class fobi.contrib.plugins.form_elements.content.content_image_url.base.ContentImageURLPlugin(user=None)[source]

Bases: fobi.base.FormElementPlugin

Content image plugin.

form

alias of ContentImageURLForm

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

get_raw_data()[source]

Get raw data.

Might be used in integration plugins.

get_rendered_image()[source]

Get rendered image.

group = <django.utils.functional.__proxy__ object>
name = <django.utils.functional.__proxy__ object>
post_processor()[source]

Post process data.

Always the same.

uid = 'content_image_url'
fobi.contrib.plugins.form_elements.content.content_image_url.conf module
fobi.contrib.plugins.form_elements.content.content_image_url.conf.get_setting(setting, override=None)[source]

Get setting.

Get a setting from fobi.contrib.plugins.form_elements.content.content_image_url conf module, falling back to the default.

If override is not None, it will be used instead of the setting.

Parameters:
  • setting – String with setting name
  • override – Value to use when no setting is available. Defaults to None.
Returns:

Setting value.

fobi.contrib.plugins.form_elements.content.content_image_url.defaults module
fobi.contrib.plugins.form_elements.content.content_image_url.fobi_form_elements module
class fobi.contrib.plugins.form_elements.content.content_image_url.fobi_form_elements.ContentImageURLPlugin(user=None)[source]

Bases: fobi.base.FormElementPlugin

Content image plugin.

form

alias of ContentImageURLForm

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

get_raw_data()[source]

Get raw data.

Might be used in integration plugins.

get_rendered_image()[source]

Get rendered image.

group = <django.utils.functional.__proxy__ object>
name = <django.utils.functional.__proxy__ object>
post_processor()[source]

Post process data.

Always the same.

uid = 'content_image_url'
fobi.contrib.plugins.form_elements.content.content_image_url.forms module
class fobi.contrib.plugins.form_elements.content.content_image_url.forms.ContentImageURLForm(data=None, files=None, auto_id=u'id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None)[source]

Bases: django.forms.forms.Form, fobi.base.BasePluginForm

Form for ContentImageURLPlugin.

base_fields = OrderedDict([('url', <django.forms.fields.URLField object at 0x7f6c0e051210>), ('alt', <django.forms.fields.CharField object at 0x7f6c0e051250>), ('fit_method', <django.forms.fields.ChoiceField object at 0x7f6c0e051310>), ('size', <django.forms.fields.ChoiceField object at 0x7f6c0e0513d0>)])
declared_fields = OrderedDict([('url', <django.forms.fields.URLField object at 0x7f6c0e051210>), ('alt', <django.forms.fields.CharField object at 0x7f6c0e051250>), ('fit_method', <django.forms.fields.ChoiceField object at 0x7f6c0e051310>), ('size', <django.forms.fields.ChoiceField object at 0x7f6c0e0513d0>)])
media
plugin_data_fields = [('url', ''), ('alt', ''), ('fit_method', 'fit_width'), ('size', '500x500')]
fobi.contrib.plugins.form_elements.content.content_image_url.settings module
  • DEFAULT_SIZE (string)
  • SIZE_100x100 (string)
  • SIZE_200x200 (string)
  • SIZE_300x300 (string)
  • SIZE_400x400 (string)
  • SIZE_500x500 (string)
  • SIZE_600x600 (tuple)
  • SIZES (list)
Module contents
fobi.contrib.plugins.form_elements.content.content_text package
Submodules
fobi.contrib.plugins.form_elements.content.content_text.apps module
class fobi.contrib.plugins.form_elements.content.content_text.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

Config.

label = 'fobi_contrib_plugins_form_elements_content_content_text'
name = 'fobi.contrib.plugins.form_elements.content.content_text'
fobi.contrib.plugins.form_elements.content.content_text.base module
class fobi.contrib.plugins.form_elements.content.content_text.base.ContentTextPlugin(user=None)[source]

Bases: fobi.base.FormElementPlugin

Content text plugin.

form

alias of ContentTextForm

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

get_raw_data()[source]

Get raw data.

Might be used in integration plugins.

get_rendered_text()[source]

Get rendered image.

group = <django.utils.functional.__proxy__ object>
name = <django.utils.functional.__proxy__ object>
post_processor()[source]

Post process data.

Always the same.

uid = 'content_text'
fobi.contrib.plugins.form_elements.content.content_text.conf module
fobi.contrib.plugins.form_elements.content.content_text.conf.get_setting(setting, override=None)[source]

Get setting.

Get a setting from fobi.contrib.plugins.form_elements.content.content_text conf module, falling back to the default.

If override is not None, it will be used instead of the setting.

Parameters:
  • setting – String with setting name
  • override – Value to use when no setting is available. Defaults to None.
Returns:

Setting value.

fobi.contrib.plugins.form_elements.content.content_text.defaults module
fobi.contrib.plugins.form_elements.content.content_text.fobi_form_elements module
class fobi.contrib.plugins.form_elements.content.content_text.fobi_form_elements.ContentTextPlugin(user=None)[source]

Bases: fobi.base.FormElementPlugin

Content text plugin.

form

alias of ContentTextForm

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

get_raw_data()[source]

Get raw data.

Might be used in integration plugins.

get_rendered_text()[source]

Get rendered image.

group = <django.utils.functional.__proxy__ object>
name = <django.utils.functional.__proxy__ object>
post_processor()[source]

Post process data.

Always the same.

uid = 'content_text'
fobi.contrib.plugins.form_elements.content.content_text.forms module
class fobi.contrib.plugins.form_elements.content.content_text.forms.ContentTextForm(data=None, files=None, auto_id=u'id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None)[source]

Bases: django.forms.forms.Form, fobi.base.BasePluginForm

Form for ContentTextPlugin.

base_fields = OrderedDict([('text', <django.forms.fields.CharField object at 0x7f6c0e051150>)])
clean_text()[source]

Clean text value.

declared_fields = OrderedDict([('text', <django.forms.fields.CharField object at 0x7f6c0e051150>)])
media
plugin_data_fields = [('text', '')]
fobi.contrib.plugins.form_elements.content.content_text.settings module
Module contents
fobi.contrib.plugins.form_elements.content.content_video package
Submodules
fobi.contrib.plugins.form_elements.content.content_video.apps module
class fobi.contrib.plugins.form_elements.content.content_video.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

Config.

label = 'fobi_contrib_plugins_form_elements_content_content_video'
name = 'fobi.contrib.plugins.form_elements.content.content_video'
fobi.contrib.plugins.form_elements.content.content_video.base module
class fobi.contrib.plugins.form_elements.content.content_video.base.ContentVideoPlugin(user=None)[source]

Bases: fobi.base.FormElementPlugin

Content video plugin.

form

alias of ContentVideoForm

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

get_raw_data()[source]

Get raw data.

Might be used in integration plugins.

get_rendered_video()[source]

Get rendered video.

Might be used in integration plugins.

group = <django.utils.functional.__proxy__ object>
name = <django.utils.functional.__proxy__ object>
post_processor()[source]

Process plugin data.

Always the same.

uid = 'content_video'
fobi.contrib.plugins.form_elements.content.content_video.conf module
fobi.contrib.plugins.form_elements.content.content_video.conf.get_setting(setting, override=None)[source]

Get setting.

Get a setting from fobi.contrib.plugins.form_elements.content.content_video conf module, falling back to the default.

If override is not None, it will be used instead of the setting.

Parameters:
  • setting – String with setting name
  • override – Value to use when no setting is available. Defaults to None.
Returns:

Setting value.

fobi.contrib.plugins.form_elements.content.content_video.defaults module
fobi.contrib.plugins.form_elements.content.content_video.fobi_form_elements module
class fobi.contrib.plugins.form_elements.content.content_video.fobi_form_elements.ContentVideoPlugin(user=None)[source]

Bases: fobi.base.FormElementPlugin

Content video plugin.

form

alias of ContentVideoForm

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

get_raw_data()[source]

Get raw data.

Might be used in integration plugins.

get_rendered_video()[source]

Get rendered video.

Might be used in integration plugins.

group = <django.utils.functional.__proxy__ object>
name = <django.utils.functional.__proxy__ object>
post_processor()[source]

Process plugin data.

Always the same.

uid = 'content_video'
fobi.contrib.plugins.form_elements.content.content_video.forms module
class fobi.contrib.plugins.form_elements.content.content_video.forms.ContentVideoForm(data=None, files=None, auto_id=u'id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None)[source]

Bases: django.forms.forms.Form, fobi.base.BasePluginForm

Form for ContentVideoPlugin.

base_fields = OrderedDict([('title', <django.forms.fields.CharField object at 0x7f6c0e040f10>), ('url', <django.forms.fields.CharField object at 0x7f6c0e040f50>), ('size', <django.forms.fields.ChoiceField object at 0x7f6c0e051050>)])
declared_fields = OrderedDict([('title', <django.forms.fields.CharField object at 0x7f6c0e040f10>), ('url', <django.forms.fields.CharField object at 0x7f6c0e040f50>), ('size', <django.forms.fields.ChoiceField object at 0x7f6c0e051050>)])
media
plugin_data_fields = [('title', ''), ('url', ''), ('size', '500x400')]
fobi.contrib.plugins.form_elements.content.content_video.settings module
Module contents
Module contents
fobi.contrib.plugins.form_elements.fields package
Subpackages
fobi.contrib.plugins.form_elements.fields.boolean package
Submodules
fobi.contrib.plugins.form_elements.fields.boolean.apps module
class fobi.contrib.plugins.form_elements.fields.boolean.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

Config.

label = 'fobi_contrib_plugins_form_elements_fields_boolean'
name = 'fobi.contrib.plugins.form_elements.fields.boolean'
fobi.contrib.plugins.form_elements.fields.boolean.base module
class fobi.contrib.plugins.form_elements.fields.boolean.base.BooleanSelectPlugin(user=None)[source]

Bases: fobi.base.FormFieldPlugin

Boolean select plugin.

form

alias of BooleanSelectForm

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
name = <django.utils.functional.__proxy__ object>
uid = 'boolean'
fobi.contrib.plugins.form_elements.fields.boolean.fobi_form_elements module
class fobi.contrib.plugins.form_elements.fields.boolean.fobi_form_elements.BooleanSelectPlugin(user=None)[source]

Bases: fobi.base.FormFieldPlugin

Boolean select plugin.

form

alias of BooleanSelectForm

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
name = <django.utils.functional.__proxy__ object>
uid = 'boolean'
fobi.contrib.plugins.form_elements.fields.boolean.forms module
Module contents
fobi.contrib.plugins.form_elements.fields.checkbox_select_multiple package
Submodules
fobi.contrib.plugins.form_elements.fields.checkbox_select_multiple.apps module
class fobi.contrib.plugins.form_elements.fields.checkbox_select_multiple.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

Config.

label = 'fobi_contrib_plugins_form_elements_fields_checkbox_select_multiple'
name = 'fobi.contrib.plugins.form_elements.fields.checkbox_select_multiple'
fobi.contrib.plugins.form_elements.fields.checkbox_select_multiple.base module
class fobi.contrib.plugins.form_elements.fields.checkbox_select_multiple.base.CheckboxSelectMultipleInputPlugin(user=None)[source]

Bases: fobi.base.FormFieldPlugin

Checkbox select multiple field plugin.

form

alias of CheckboxSelectMultipleInputForm

get_choices()[source]

Get choices.

Might be used in integration plugins.

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
name = <django.utils.functional.__proxy__ object>
prepare_plugin_form_data(cleaned_data)[source]

Prepare plugin form data.

Might be used in integration plugins.

submit_plugin_form_data(form_entry, request, form, form_element_entries=None, **kwargs)[source]

Submit plugin form data/process.

Parameters:
  • form_entry (fobi.models.FormEntry) – Instance of fobi.models.FormEntry.
  • request (django.http.HttpRequest) –
  • form (django.forms.Form) –
uid = 'checkbox_select_multiple'
fobi.contrib.plugins.form_elements.fields.checkbox_select_multiple.conf module
fobi.contrib.plugins.form_elements.fields.checkbox_select_multiple.conf.get_setting(setting, override=None)[source]

Get setting.

Get a setting from fobi.contrib.plugins.form_elements.fields.checkbox_select_multiple conf module, falling back to the default.

If override is not None, it will be used instead of the setting.

Parameters:
  • setting – String with setting name
  • override – Value to use when no setting is available. Defaults to None.
Returns:

Setting value.

fobi.contrib.plugins.form_elements.fields.checkbox_select_multiple.defaults module
fobi.contrib.plugins.form_elements.fields.checkbox_select_multiple.fobi_form_elements module
class fobi.contrib.plugins.form_elements.fields.checkbox_select_multiple.fobi_form_elements.CheckboxSelectMultipleInputPlugin(user=None)[source]

Bases: fobi.base.FormFieldPlugin

Checkbox select multiple field plugin.

form

alias of CheckboxSelectMultipleInputForm

get_choices()[source]

Get choices.

Might be used in integration plugins.

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
name = <django.utils.functional.__proxy__ object>
prepare_plugin_form_data(cleaned_data)[source]

Prepare plugin form data.

Might be used in integration plugins.

submit_plugin_form_data(form_entry, request, form, form_element_entries=None, **kwargs)[source]

Submit plugin form data/process.

Parameters:
  • form_entry (fobi.models.FormEntry) – Instance of fobi.models.FormEntry.
  • request (django.http.HttpRequest) –
  • form (django.forms.Form) –
uid = 'checkbox_select_multiple'
fobi.contrib.plugins.form_elements.fields.checkbox_select_multiple.forms module
class fobi.contrib.plugins.form_elements.fields.checkbox_select_multiple.forms.CheckboxSelectMultipleInputForm(data=None, files=None, auto_id=u'id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None)[source]

Bases: django.forms.forms.Form, fobi.base.BaseFormFieldPluginForm

Form for CheckboxSelectMultipleInputPlugin.

base_fields = OrderedDict([('label', <django.forms.fields.CharField object at 0x7f6c0dfeb590>), ('name', <django.forms.fields.CharField object at 0x7f6c0dfeb5d0>), ('choices', <django.forms.fields.CharField object at 0x7f6c0dfeb6d0>), ('help_text', <django.forms.fields.CharField object at 0x7f6c0dfeb790>), ('initial', <django.forms.fields.CharField object at 0x7f6c0dfeb850>), ('required', <django.forms.fields.BooleanField object at 0x7f6c0dfeb910>)])
clean_initial()[source]

Validating the initial value.

declared_fields = OrderedDict([('label', <django.forms.fields.CharField object at 0x7f6c0dfeb590>), ('name', <django.forms.fields.CharField object at 0x7f6c0dfeb5d0>), ('choices', <django.forms.fields.CharField object at 0x7f6c0dfeb6d0>), ('help_text', <django.forms.fields.CharField object at 0x7f6c0dfeb790>), ('initial', <django.forms.fields.CharField object at 0x7f6c0dfeb850>), ('required', <django.forms.fields.BooleanField object at 0x7f6c0dfeb910>)])
media
plugin_data_fields = [('label', ''), ('name', ''), ('choices', ''), ('help_text', ''), ('initial', ''), ('required', False)]
fobi.contrib.plugins.form_elements.fields.checkbox_select_multiple.settings module
Module contents
fobi.contrib.plugins.form_elements.fields.date package
Submodules
fobi.contrib.plugins.form_elements.fields.date.apps module
class fobi.contrib.plugins.form_elements.fields.date.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

Config.

label = 'fobi_contrib_plugins_form_elements_fields_date'
name = 'fobi.contrib.plugins.form_elements.fields.date'
fobi.contrib.plugins.form_elements.fields.date.base module
class fobi.contrib.plugins.form_elements.fields.date.base.DateInputPlugin(user=None)[source]

Bases: fobi.base.FormFieldPlugin

Date field plugin.

form

alias of DateInputForm

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
name = <django.utils.functional.__proxy__ object>
submit_plugin_form_data(form_entry, request, form, form_element_entries=None, **kwargs)[source]

Submit plugin form data/process.

Parameters:
  • form_entry (fobi.models.FormEntry) – Instance of fobi.models.FormEntry.
  • request (django.http.HttpRequest) –
  • form (django.forms.Form) –
uid = 'date'
fobi.contrib.plugins.form_elements.fields.date.fobi_form_elements module
class fobi.contrib.plugins.form_elements.fields.date.fobi_form_elements.DateInputPlugin(user=None)[source]

Bases: fobi.base.FormFieldPlugin

Date field plugin.

form

alias of DateInputForm

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
name = <django.utils.functional.__proxy__ object>
submit_plugin_form_data(form_entry, request, form, form_element_entries=None, **kwargs)[source]

Submit plugin form data/process.

Parameters:
  • form_entry (fobi.models.FormEntry) – Instance of fobi.models.FormEntry.
  • request (django.http.HttpRequest) –
  • form (django.forms.Form) –
uid = 'date'
fobi.contrib.plugins.form_elements.fields.date.forms module
class fobi.contrib.plugins.form_elements.fields.date.forms.DateInputForm(data=None, files=None, auto_id=u'id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None)[source]

Bases: django.forms.forms.Form, fobi.base.BaseFormFieldPluginForm

Form for DateInputPlugin.

base_fields = OrderedDict([('label', <django.forms.fields.CharField object at 0x7f6c0e925a10>), ('name', <django.forms.fields.CharField object at 0x7f6c0dfeb110>), ('help_text', <django.forms.fields.CharField object at 0x7f6c0dfeb1d0>), ('initial', <django.forms.fields.DateField object at 0x7f6c0dfeb290>), ('input_formats', <django.forms.fields.CharField object at 0x7f6c0dfeb350>), ('required', <django.forms.fields.BooleanField object at 0x7f6c0dfeb410>)])
clean_initial()[source]

Clean the initial value.

declared_fields = OrderedDict([('label', <django.forms.fields.CharField object at 0x7f6c0e925a10>), ('name', <django.forms.fields.CharField object at 0x7f6c0dfeb110>), ('help_text', <django.forms.fields.CharField object at 0x7f6c0dfeb1d0>), ('initial', <django.forms.fields.DateField object at 0x7f6c0dfeb290>), ('input_formats', <django.forms.fields.CharField object at 0x7f6c0dfeb350>), ('required', <django.forms.fields.BooleanField object at 0x7f6c0dfeb410>)])
media
plugin_data_fields = [('label', ''), ('name', ''), ('help_text', ''), ('initial', ''), ('input_formats', ''), ('required', False)]
fobi.contrib.plugins.form_elements.fields.date.widgets module
class fobi.contrib.plugins.form_elements.fields.date.widgets.BaseDatePluginWidget(plugin)[source]

Bases: fobi.base.FormElementPluginWidget

Base date form element plugin widget.

plugin_uid = 'date'
Module contents
fobi.contrib.plugins.form_elements.fields.date_drop_down package
Submodules
fobi.contrib.plugins.form_elements.fields.date_drop_down.apps module
class fobi.contrib.plugins.form_elements.fields.date_drop_down.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

Config.

label = 'fobi_contrib_plugins_form_elements_fields_date_drop_down'
name = 'fobi.contrib.plugins.form_elements.fields.date_drop_down'
fobi.contrib.plugins.form_elements.fields.date_drop_down.base module
class fobi.contrib.plugins.form_elements.fields.date_drop_down.base.DateDropDownInputPlugin(user=None)[source]

Bases: fobi.base.FormFieldPlugin

Date drop down field plugin.

form

alias of DateDropDownInputForm

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
name = <django.utils.functional.__proxy__ object>
submit_plugin_form_data(form_entry, request, form, form_element_entries=None, **kwargs)[source]

Submit plugin form data/process.

Parameters:
  • form_entry (fobi.models.FormEntry) – Instance of fobi.models.FormEntry.
  • request (django.http.HttpRequest) –
  • form (django.forms.Form) –
uid = 'date_drop_down'
fobi.contrib.plugins.form_elements.fields.date_drop_down.fobi_form_elements module
class fobi.contrib.plugins.form_elements.fields.date_drop_down.fobi_form_elements.DateDropDownInputPlugin(user=None)[source]

Bases: fobi.base.FormFieldPlugin

Date drop down field plugin.

form

alias of DateDropDownInputForm

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
name = <django.utils.functional.__proxy__ object>
submit_plugin_form_data(form_entry, request, form, form_element_entries=None, **kwargs)[source]

Submit plugin form data/process.

Parameters:
  • form_entry (fobi.models.FormEntry) – Instance of fobi.models.FormEntry.
  • request (django.http.HttpRequest) –
  • form (django.forms.Form) –
uid = 'date_drop_down'
fobi.contrib.plugins.form_elements.fields.date_drop_down.forms module
class fobi.contrib.plugins.form_elements.fields.date_drop_down.forms.DateDropDownInputForm(data=None, files=None, auto_id=u'id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None)[source]

Bases: django.forms.forms.Form, fobi.base.BaseFormFieldPluginForm

Form for DateDropDownInputPlugin.

base_fields = OrderedDict([('label', <django.forms.fields.CharField object at 0x7f6c0dfdda90>), ('name', <django.forms.fields.CharField object at 0x7f6c0dfddad0>), ('help_text', <django.forms.fields.CharField object at 0x7f6c0dfddb90>), ('year_min', <django.forms.fields.IntegerField object at 0x7f6c0dfddc50>), ('year_max', <django.forms.fields.IntegerField object at 0x7f6c0dfddd10>), ('initial', <django.forms.fields.CharField object at 0x7f6c0dfdddd0>), ('input_formats', <django.forms.fields.CharField object at 0x7f6c0dfdde90>), ('required', <django.forms.fields.BooleanField object at 0x7f6c0dfddf50>)])
declared_fields = OrderedDict([('label', <django.forms.fields.CharField object at 0x7f6c0dfdda90>), ('name', <django.forms.fields.CharField object at 0x7f6c0dfddad0>), ('help_text', <django.forms.fields.CharField object at 0x7f6c0dfddb90>), ('year_min', <django.forms.fields.IntegerField object at 0x7f6c0dfddc50>), ('year_max', <django.forms.fields.IntegerField object at 0x7f6c0dfddd10>), ('initial', <django.forms.fields.CharField object at 0x7f6c0dfdddd0>), ('input_formats', <django.forms.fields.CharField object at 0x7f6c0dfdde90>), ('required', <django.forms.fields.BooleanField object at 0x7f6c0dfddf50>)])
media
plugin_data_fields = [('label', ''), ('name', ''), ('help_text', ''), ('year_min', ''), ('year_max', ''), ('initial', ''), ('input_formats', ''), ('required', False)]
Module contents
fobi.contrib.plugins.form_elements.fields.datetime package
Submodules
fobi.contrib.plugins.form_elements.fields.datetime.apps module
class fobi.contrib.plugins.form_elements.fields.datetime.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

Config.

label = 'fobi_contrib_plugins_form_elements_fields_datetime'
name = 'fobi.contrib.plugins.form_elements.fields.datetime'
fobi.contrib.plugins.form_elements.fields.datetime.base module
class fobi.contrib.plugins.form_elements.fields.datetime.base.DateTimeInputPlugin(user=None)[source]

Bases: fobi.base.FormFieldPlugin

DateTime field plugin.

form

alias of DateTimeInputForm

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
name = <django.utils.functional.__proxy__ object>
submit_plugin_form_data(form_entry, request, form, form_element_entries=None, **kwargs)[source]

Submit plugin form data/process.

Parameters:
  • form_entry (fobi.models.FormEntry) – Instance of fobi.models.FormEntry.
  • request (django.http.HttpRequest) –
  • form (django.forms.Form) –
uid = 'datetime'
fobi.contrib.plugins.form_elements.fields.datetime.fobi_form_elements module
class fobi.contrib.plugins.form_elements.fields.datetime.fobi_form_elements.DateTimeInputPlugin(user=None)[source]

Bases: fobi.base.FormFieldPlugin

DateTime field plugin.

form

alias of DateTimeInputForm

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
name = <django.utils.functional.__proxy__ object>
submit_plugin_form_data(form_entry, request, form, form_element_entries=None, **kwargs)[source]

Submit plugin form data/process.

Parameters:
  • form_entry (fobi.models.FormEntry) – Instance of fobi.models.FormEntry.
  • request (django.http.HttpRequest) –
  • form (django.forms.Form) –
uid = 'datetime'
fobi.contrib.plugins.form_elements.fields.datetime.forms module
class fobi.contrib.plugins.form_elements.fields.datetime.forms.DateTimeInputForm(data=None, files=None, auto_id=u'id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None)[source]

Bases: django.forms.forms.Form, fobi.base.BaseFormFieldPluginForm

Form for DateTimeInputPlugin.

base_fields = OrderedDict([('label', <django.forms.fields.CharField object at 0x7f6c0dfdd510>), ('name', <django.forms.fields.CharField object at 0x7f6c0dfdd610>), ('help_text', <django.forms.fields.CharField object at 0x7f6c0dfdd6d0>), ('initial', <django.forms.fields.DateTimeField object at 0x7f6c0dfdd790>), ('input_formats', <django.forms.fields.CharField object at 0x7f6c0dfdd850>), ('required', <django.forms.fields.BooleanField object at 0x7f6c0dfdd910>)])
clean_initial()[source]

Clean the initial value.

declared_fields = OrderedDict([('label', <django.forms.fields.CharField object at 0x7f6c0dfdd510>), ('name', <django.forms.fields.CharField object at 0x7f6c0dfdd610>), ('help_text', <django.forms.fields.CharField object at 0x7f6c0dfdd6d0>), ('initial', <django.forms.fields.DateTimeField object at 0x7f6c0dfdd790>), ('input_formats', <django.forms.fields.CharField object at 0x7f6c0dfdd850>), ('required', <django.forms.fields.BooleanField object at 0x7f6c0dfdd910>)])
media
plugin_data_fields = [('label', ''), ('name', ''), ('help_text', ''), ('initial', ''), ('input_formats', ''), ('required', False)]
fobi.contrib.plugins.form_elements.fields.datetime.widgets module
class fobi.contrib.plugins.form_elements.fields.datetime.widgets.BaseDateTimePluginWidget(plugin)[source]

Bases: fobi.base.FormElementPluginWidget

Base datetime form element plugin widget.

plugin_uid = 'datetime'
Module contents
fobi.contrib.plugins.form_elements.fields.decimal package
Submodules
fobi.contrib.plugins.form_elements.fields.decimal.apps module
class fobi.contrib.plugins.form_elements.fields.decimal.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

Config.

label = 'fobi_contrib_plugins_form_elements_fields_decimal'
name = 'fobi.contrib.plugins.form_elements.fields.decimal'
fobi.contrib.plugins.form_elements.fields.decimal.base module
class fobi.contrib.plugins.form_elements.fields.decimal.base.DecimalInputPlugin(user=None)[source]

Bases: fobi.base.FormFieldPlugin

Decimal input plugin.

form

alias of DecimalInputForm

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
name = <django.utils.functional.__proxy__ object>
uid = 'decimal'
fobi.contrib.plugins.form_elements.fields.decimal.fobi_form_elements module
class fobi.contrib.plugins.form_elements.fields.decimal.fobi_form_elements.DecimalInputPlugin(user=None)[source]

Bases: fobi.base.FormFieldPlugin

Decimal input plugin.

form

alias of DecimalInputForm

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
name = <django.utils.functional.__proxy__ object>
uid = 'decimal'
fobi.contrib.plugins.form_elements.fields.decimal.forms module
class fobi.contrib.plugins.form_elements.fields.decimal.forms.DecimalInputForm(data=None, files=None, auto_id=u'id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None)[source]

Bases: django.forms.forms.Form, fobi.base.BaseFormFieldPluginForm

Form for DecimalInputPlugin.

base_fields = OrderedDict([('label', <django.forms.fields.CharField object at 0x7f6c0e9366d0>), ('name', <django.forms.fields.CharField object at 0x7f6c0dfd2d10>), ('help_text', <django.forms.fields.CharField object at 0x7f6c0dfd2dd0>), ('initial', <django.forms.fields.DecimalField object at 0x7f6c0dfd2e90>), ('max_digits', <django.forms.fields.IntegerField object at 0x7f6c0dfd2f90>), ('decimal_places', <django.forms.fields.IntegerField object at 0x7f6c0dfdd090>), ('min_value', <django.forms.fields.DecimalField object at 0x7f6c0dfdd150>), ('max_value', <django.forms.fields.DecimalField object at 0x7f6c0dfdd250>), ('required', <django.forms.fields.BooleanField object at 0x7f6c0dfdd350>), ('placeholder', <django.forms.fields.CharField object at 0x7f6c0dfdd410>)])
clean()[source]

Validating the values.

declared_fields = OrderedDict([('label', <django.forms.fields.CharField object at 0x7f6c0e9366d0>), ('name', <django.forms.fields.CharField object at 0x7f6c0dfd2d10>), ('help_text', <django.forms.fields.CharField object at 0x7f6c0dfd2dd0>), ('initial', <django.forms.fields.DecimalField object at 0x7f6c0dfd2e90>), ('max_digits', <django.forms.fields.IntegerField object at 0x7f6c0dfd2f90>), ('decimal_places', <django.forms.fields.IntegerField object at 0x7f6c0dfdd090>), ('min_value', <django.forms.fields.DecimalField object at 0x7f6c0dfdd150>), ('max_value', <django.forms.fields.DecimalField object at 0x7f6c0dfdd250>), ('required', <django.forms.fields.BooleanField object at 0x7f6c0dfdd350>), ('placeholder', <django.forms.fields.CharField object at 0x7f6c0dfdd410>)])
media
plugin_data_fields = [('label', ''), ('name', ''), ('help_text', ''), ('initial', ''), ('max_digits', ''), ('decimal_places', ''), ('min_value', None), ('max_value', None), ('required', False), ('placeholder', '')]
quantize(value, decimal_places, max_digits)[source]

Quantize the decimal value to the configured precision.

Module contents
fobi.contrib.plugins.form_elements.fields.email package
Submodules
fobi.contrib.plugins.form_elements.fields.email.apps module
class fobi.contrib.plugins.form_elements.fields.email.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

Config.

label = 'fobi_contrib_plugins_form_elements_fields_email'
name = 'fobi.contrib.plugins.form_elements.fields.email'
fobi.contrib.plugins.form_elements.fields.email.base module
class fobi.contrib.plugins.form_elements.fields.email.base.EmailInputPlugin(user=None)[source]

Bases: fobi.base.FormFieldPlugin

Email input plugin.

form

alias of EmailInputForm

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
name = <django.utils.functional.__proxy__ object>
uid = 'email'
fobi.contrib.plugins.form_elements.fields.email.fobi_form_elements module
class fobi.contrib.plugins.form_elements.fields.email.fobi_form_elements.EmailInputPlugin(user=None)[source]

Bases: fobi.base.FormFieldPlugin

Email input plugin.

form

alias of EmailInputForm

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
name = <django.utils.functional.__proxy__ object>
uid = 'email'
fobi.contrib.plugins.form_elements.fields.email.forms module
class fobi.contrib.plugins.form_elements.fields.email.forms.EmailInputForm(data=None, files=None, auto_id=u'id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None)[source]

Bases: django.forms.forms.Form, fobi.base.BaseFormFieldPluginForm

Form for EmailInputPlugin.

base_fields = OrderedDict([('label', <django.forms.fields.CharField object at 0x7f6c0dfd2150>), ('name', <django.forms.fields.CharField object at 0x7f6c0dfd2250>), ('help_text', <django.forms.fields.CharField object at 0x7f6c0dfd2310>), ('initial', <django.forms.fields.EmailField object at 0x7f6c0dfd23d0>), ('max_length', <django.forms.fields.IntegerField object at 0x7f6c0dfd24d0>), ('required', <django.forms.fields.BooleanField object at 0x7f6c0dfd2590>), ('placeholder', <django.forms.fields.CharField object at 0x7f6c0dfd2650>)])
clean()[source]
declared_fields = OrderedDict([('label', <django.forms.fields.CharField object at 0x7f6c0dfd2150>), ('name', <django.forms.fields.CharField object at 0x7f6c0dfd2250>), ('help_text', <django.forms.fields.CharField object at 0x7f6c0dfd2310>), ('initial', <django.forms.fields.EmailField object at 0x7f6c0dfd23d0>), ('max_length', <django.forms.fields.IntegerField object at 0x7f6c0dfd24d0>), ('required', <django.forms.fields.BooleanField object at 0x7f6c0dfd2590>), ('placeholder', <django.forms.fields.CharField object at 0x7f6c0dfd2650>)])
media
plugin_data_fields = [('label', ''), ('name', ''), ('help_text', ''), ('initial', ''), ('max_length', '255'), ('required', False), ('placeholder', '')]
Module contents
fobi.contrib.plugins.form_elements.fields.file package
Submodules
fobi.contrib.plugins.form_elements.fields.file.apps module
class fobi.contrib.plugins.form_elements.fields.file.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

Config.

label = 'fobi_contrib_plugins_form_elements_fields_file'
name = 'fobi.contrib.plugins.form_elements.fields.file'
fobi.contrib.plugins.form_elements.fields.file.base module
class fobi.contrib.plugins.form_elements.fields.file.base.FileInputPlugin(user=None)[source]

Bases: fobi.base.FormFieldPlugin

File field plugin.

form

alias of FileInputForm

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
name = <django.utils.functional.__proxy__ object>
prepare_plugin_form_data(cleaned_data)[source]
submit_plugin_form_data(form_entry, request, form, form_element_entries=None, **kwargs)[source]

Submit plugin form data/process file upload.

Handling the posted data for file plugin when form is submitted. This method affects the original form and that’s why it returns it.

Parameters:
  • form_entry (fobi.models.FormEntry) – Instance of fobi.models.FormEntry.
  • request (django.http.HttpRequest) –
  • form (django.forms.Form) –
uid = 'file'
fobi.contrib.plugins.form_elements.fields.file.conf module
fobi.contrib.plugins.form_elements.fields.file.conf.get_setting(setting, override=None)[source]

Get setting.

Get a setting from fobi.contrib.plugins.form_elements.fields.conf module, falling back to the default.

If override is not None, it will be used instead of the setting.

Parameters:
  • setting – String with setting name
  • override – Value to use when no setting is available. Defaults to None.
Returns:

Setting value.

fobi.contrib.plugins.form_elements.fields.file.defaults module
fobi.contrib.plugins.form_elements.fields.file.fobi_form_elements module
class fobi.contrib.plugins.form_elements.fields.file.fobi_form_elements.FileInputPlugin(user=None)[source]

Bases: fobi.base.FormFieldPlugin

File field plugin.

form

alias of FileInputForm

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
name = <django.utils.functional.__proxy__ object>
prepare_plugin_form_data(cleaned_data)[source]
submit_plugin_form_data(form_entry, request, form, form_element_entries=None, **kwargs)[source]

Submit plugin form data/process file upload.

Handling the posted data for file plugin when form is submitted. This method affects the original form and that’s why it returns it.

Parameters:
  • form_entry (fobi.models.FormEntry) – Instance of fobi.models.FormEntry.
  • request (django.http.HttpRequest) –
  • form (django.forms.Form) –
uid = 'file'
fobi.contrib.plugins.form_elements.fields.file.forms module
class fobi.contrib.plugins.form_elements.fields.file.forms.FileInputForm(data=None, files=None, auto_id=u'id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None)[source]

Bases: django.forms.forms.Form, fobi.base.BaseFormFieldPluginForm

Form for FileInputPlugin.

base_fields = OrderedDict([('label', <django.forms.fields.CharField object at 0x7f6c0dfc5c10>), ('name', <django.forms.fields.CharField object at 0x7f6c0dfc5c50>), ('help_text', <django.forms.fields.CharField object at 0x7f6c0dfc5d10>), ('initial', <django.forms.fields.CharField object at 0x7f6c0dfc5dd0>), ('max_length', <django.forms.fields.IntegerField object at 0x7f6c0dfc5ed0>), ('required', <django.forms.fields.BooleanField object at 0x7f6c0dfc5f90>)])
clean()[source]
declared_fields = OrderedDict([('label', <django.forms.fields.CharField object at 0x7f6c0dfc5c10>), ('name', <django.forms.fields.CharField object at 0x7f6c0dfc5c50>), ('help_text', <django.forms.fields.CharField object at 0x7f6c0dfc5d10>), ('initial', <django.forms.fields.CharField object at 0x7f6c0dfc5dd0>), ('max_length', <django.forms.fields.IntegerField object at 0x7f6c0dfc5ed0>), ('required', <django.forms.fields.BooleanField object at 0x7f6c0dfc5f90>)])
media
plugin_data_fields = [('label', ''), ('name', ''), ('help_text', ''), ('initial', ''), ('max_length', '255'), ('required', False)]
fobi.contrib.plugins.form_elements.fields.file.settings module
  • FILES_UPLOAD_DIR (string)
Module contents
fobi.contrib.plugins.form_elements.fields.float package
Submodules
fobi.contrib.plugins.form_elements.fields.float.apps module
class fobi.contrib.plugins.form_elements.fields.float.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

Config.

label = 'fobi_contrib_plugins_form_elements_fields_float'
name = 'fobi.contrib.plugins.form_elements.fields.float'
fobi.contrib.plugins.form_elements.fields.float.base module
class fobi.contrib.plugins.form_elements.fields.float.base.FloatInputPlugin(user=None)[source]

Bases: fobi.base.FormFieldPlugin

Float input plugin.

form

alias of FloatInputForm

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
name = <django.utils.functional.__proxy__ object>
uid = 'float'
fobi.contrib.plugins.form_elements.fields.float.fobi_form_elements module
class fobi.contrib.plugins.form_elements.fields.float.fobi_form_elements.FloatInputPlugin(user=None)[source]

Bases: fobi.base.FormFieldPlugin

Float input plugin.

form

alias of FloatInputForm

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
name = <django.utils.functional.__proxy__ object>
uid = 'float'
fobi.contrib.plugins.form_elements.fields.float.forms module
class fobi.contrib.plugins.form_elements.fields.float.forms.FloatInputForm(data=None, files=None, auto_id=u'id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None)[source]

Bases: django.forms.forms.Form, fobi.base.BaseFormFieldPluginForm

Form for FloatInputPlugin.

base_fields = OrderedDict([('label', <django.forms.fields.CharField object at 0x7f6c0dfc55d0>), ('name', <django.forms.fields.CharField object at 0x7f6c0dfc5610>), ('help_text', <django.forms.fields.CharField object at 0x7f6c0dfc56d0>), ('initial', <django.forms.fields.FloatField object at 0x7f6c0dfc5790>), ('min_value', <django.forms.fields.FloatField object at 0x7f6c0dfc5850>), ('max_value', <django.forms.fields.FloatField object at 0x7f6c0dfc5910>), ('required', <django.forms.fields.BooleanField object at 0x7f6c0dfc59d0>), ('placeholder', <django.forms.fields.CharField object at 0x7f6c0dfc5a90>)])
clean()[source]

Validating the values.

declared_fields = OrderedDict([('label', <django.forms.fields.CharField object at 0x7f6c0dfc55d0>), ('name', <django.forms.fields.CharField object at 0x7f6c0dfc5610>), ('help_text', <django.forms.fields.CharField object at 0x7f6c0dfc56d0>), ('initial', <django.forms.fields.FloatField object at 0x7f6c0dfc5790>), ('min_value', <django.forms.fields.FloatField object at 0x7f6c0dfc5850>), ('max_value', <django.forms.fields.FloatField object at 0x7f6c0dfc5910>), ('required', <django.forms.fields.BooleanField object at 0x7f6c0dfc59d0>), ('placeholder', <django.forms.fields.CharField object at 0x7f6c0dfc5a90>)])
media
plugin_data_fields = [('label', ''), ('name', ''), ('help_text', ''), ('initial', ''), ('min_value', None), ('max_value', None), ('required', False), ('placeholder', '')]
Module contents
fobi.contrib.plugins.form_elements.fields.hidden package
Submodules
fobi.contrib.plugins.form_elements.fields.hidden.apps module
class fobi.contrib.plugins.form_elements.fields.hidden.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

Config.

label = 'fobi_contrib_plugins_form_elements_fields_hidden'
name = 'fobi.contrib.plugins.form_elements.fields.hidden'
fobi.contrib.plugins.form_elements.fields.hidden.base module
class fobi.contrib.plugins.form_elements.fields.hidden.base.HiddenInputPlugin(user=None)[source]

Bases: fobi.base.FormFieldPlugin

Hidden field plugin.

form

alias of HiddenInputForm

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
is_hidden = True
name = <django.utils.functional.__proxy__ object>
uid = 'hidden'
fobi.contrib.plugins.form_elements.fields.hidden.fobi_form_elements module
class fobi.contrib.plugins.form_elements.fields.hidden.fobi_form_elements.HiddenInputPlugin(user=None)[source]

Bases: fobi.base.FormFieldPlugin

Hidden field plugin.

form

alias of HiddenInputForm

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
is_hidden = True
name = <django.utils.functional.__proxy__ object>
uid = 'hidden'
fobi.contrib.plugins.form_elements.fields.hidden.forms module
class fobi.contrib.plugins.form_elements.fields.hidden.forms.HiddenInputForm(data=None, files=None, auto_id=u'id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None)[source]

Bases: django.forms.forms.Form, fobi.base.BaseFormFieldPluginForm

Form for HiddenInputPlugin.

base_fields = OrderedDict([('label', <django.forms.fields.CharField object at 0x7f6c0dfc5190>), ('name', <django.forms.fields.CharField object at 0x7f6c0dfc51d0>), ('initial', <django.forms.fields.CharField object at 0x7f6c0dfc5290>), ('max_length', <django.forms.fields.IntegerField object at 0x7f6c0dfc5390>), ('required', <django.forms.fields.BooleanField object at 0x7f6c0dfc5450>)])
clean()[source]
declared_fields = OrderedDict([('label', <django.forms.fields.CharField object at 0x7f6c0dfc5190>), ('name', <django.forms.fields.CharField object at 0x7f6c0dfc51d0>), ('initial', <django.forms.fields.CharField object at 0x7f6c0dfc5290>), ('max_length', <django.forms.fields.IntegerField object at 0x7f6c0dfc5390>), ('required', <django.forms.fields.BooleanField object at 0x7f6c0dfc5450>)])
media
plugin_data_fields = [('label', ''), ('name', ''), ('initial', ''), ('max_length', '255'), ('required', False)]
Module contents
fobi.contrib.plugins.form_elements.fields.input package
Submodules
fobi.contrib.plugins.form_elements.fields.input.apps module
class fobi.contrib.plugins.form_elements.fields.input.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

Config.

label = 'fobi_contrib_plugins_form_elements_fields_input'
name = 'fobi.contrib.plugins.form_elements.fields.input'
fobi.contrib.plugins.form_elements.fields.input.base module
class fobi.contrib.plugins.form_elements.fields.input.base.InputPlugin(user=None)[source]

Bases: fobi.base.FormFieldPlugin

Input field plugin.

form

alias of InputForm

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
name = <django.utils.functional.__proxy__ object>
uid = 'input'
fobi.contrib.plugins.form_elements.fields.input.constants module
fobi.contrib.plugins.form_elements.fields.input.fobi_form_elements module
class fobi.contrib.plugins.form_elements.fields.input.fobi_form_elements.InputPlugin(user=None)[source]

Bases: fobi.base.FormFieldPlugin

Input field plugin.

form

alias of InputForm

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
name = <django.utils.functional.__proxy__ object>
uid = 'input'
fobi.contrib.plugins.form_elements.fields.input.forms module
class fobi.contrib.plugins.form_elements.fields.input.forms.InputForm(data=None, files=None, auto_id=u'id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None)[source]

Bases: django.forms.forms.Form, fobi.base.BaseFormFieldPluginForm

Form for InputPlugin.

base_fields = OrderedDict([('label', <django.forms.fields.CharField object at 0x7f6c0e038350>), ('name', <django.forms.fields.CharField object at 0x7f6c0e038390>), ('help_text', <django.forms.fields.CharField object at 0x7f6c0e038450>), ('initial', <django.forms.fields.CharField object at 0x7f6c0e038510>), ('max_length', <django.forms.fields.IntegerField object at 0x7f6c0e038610>), ('required', <django.forms.fields.BooleanField object at 0x7f6c0e0386d0>), ('placeholder', <django.forms.fields.CharField object at 0x7f6c0e038790>), ('autocomplete_value', <django.forms.fields.BooleanField object at 0x7f6c0e038850>), ('autofocus_value', <django.forms.fields.BooleanField object at 0x7f6c0e038910>), ('disabled_value', <django.forms.fields.BooleanField object at 0x7f6c0e0389d0>), ('list_value', <django.forms.fields.CharField object at 0x7f6c0e038a90>), ('max_value', <django.forms.fields.CharField object at 0x7f6c0e038b50>), ('min_value', <django.forms.fields.CharField object at 0x7f6c0e038c10>), ('multiple_value', <django.forms.fields.BooleanField object at 0x7f6c0e038cd0>), ('pattern_value', <django.forms.fields.CharField object at 0x7f6c0e038d90>), ('readonly_value', <django.forms.fields.BooleanField object at 0x7f6c0e038e50>), ('step_value', <django.forms.fields.IntegerField object at 0x7f6c0e038f10>), ('type_value', <django.forms.fields.ChoiceField object at 0x7f6c0e038fd0>)])
clean()[source]
declared_fields = OrderedDict([('label', <django.forms.fields.CharField object at 0x7f6c0e038350>), ('name', <django.forms.fields.CharField object at 0x7f6c0e038390>), ('help_text', <django.forms.fields.CharField object at 0x7f6c0e038450>), ('initial', <django.forms.fields.CharField object at 0x7f6c0e038510>), ('max_length', <django.forms.fields.IntegerField object at 0x7f6c0e038610>), ('required', <django.forms.fields.BooleanField object at 0x7f6c0e0386d0>), ('placeholder', <django.forms.fields.CharField object at 0x7f6c0e038790>), ('autocomplete_value', <django.forms.fields.BooleanField object at 0x7f6c0e038850>), ('autofocus_value', <django.forms.fields.BooleanField object at 0x7f6c0e038910>), ('disabled_value', <django.forms.fields.BooleanField object at 0x7f6c0e0389d0>), ('list_value', <django.forms.fields.CharField object at 0x7f6c0e038a90>), ('max_value', <django.forms.fields.CharField object at 0x7f6c0e038b50>), ('min_value', <django.forms.fields.CharField object at 0x7f6c0e038c10>), ('multiple_value', <django.forms.fields.BooleanField object at 0x7f6c0e038cd0>), ('pattern_value', <django.forms.fields.CharField object at 0x7f6c0e038d90>), ('readonly_value', <django.forms.fields.BooleanField object at 0x7f6c0e038e50>), ('step_value', <django.forms.fields.IntegerField object at 0x7f6c0e038f10>), ('type_value', <django.forms.fields.ChoiceField object at 0x7f6c0e038fd0>)])
media
plugin_data_fields = [('label', ''), ('name', ''), ('help_text', ''), ('initial', ''), ('max_length', '255'), ('required', False), ('placeholder', ''), ('autocomplete_value', 'off'), ('autofocus_value', False), ('disabled_value', False), ('list_value', ''), ('max_value', ''), ('min_value', ''), ('multiple_value', False), ('pattern_value', ''), ('readonly_value', False), ('step_value', ''), ('type_value', 'text')]
Module contents
fobi.contrib.plugins.form_elements.fields.integer package
Submodules
fobi.contrib.plugins.form_elements.fields.integer.apps module
class fobi.contrib.plugins.form_elements.fields.integer.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

Config.

label = 'fobi_contrib_plugins_form_elements_fields_integer'
name = 'fobi.contrib.plugins.form_elements.fields.integer'
fobi.contrib.plugins.form_elements.fields.integer.base module
class fobi.contrib.plugins.form_elements.fields.integer.base.IntegerInputPlugin(user=None)[source]

Bases: fobi.base.FormFieldPlugin

Integer input plugin.

form

alias of IntegerInputForm

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
name = <django.utils.functional.__proxy__ object>
uid = 'integer'
fobi.contrib.plugins.form_elements.fields.integer.fobi_form_elements module
class fobi.contrib.plugins.form_elements.fields.integer.fobi_form_elements.IntegerInputPlugin(user=None)[source]

Bases: fobi.base.FormFieldPlugin

Integer input plugin.

form

alias of IntegerInputForm

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
name = <django.utils.functional.__proxy__ object>
uid = 'integer'
fobi.contrib.plugins.form_elements.fields.integer.forms module
class fobi.contrib.plugins.form_elements.fields.integer.forms.IntegerInputForm(data=None, files=None, auto_id=u'id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None)[source]

Bases: django.forms.forms.Form, fobi.base.BaseFormFieldPluginForm

Form for IntegerInputPlugin.

base_fields = OrderedDict([('label', <django.forms.fields.CharField object at 0x7f6c0e8e9cd0>), ('name', <django.forms.fields.CharField object at 0x7f6c0e8e9d10>), ('help_text', <django.forms.fields.CharField object at 0x7f6c0e8e9dd0>), ('initial', <django.forms.fields.IntegerField object at 0x7f6c0e8e9e90>), ('min_value', <django.forms.fields.IntegerField object at 0x7f6c0e8e9f50>), ('max_value', <django.forms.fields.IntegerField object at 0x7f6c0e038050>), ('required', <django.forms.fields.BooleanField object at 0x7f6c0e038110>), ('placeholder', <django.forms.fields.CharField object at 0x7f6c0e0381d0>)])
clean()[source]

Validating the values.

declared_fields = OrderedDict([('label', <django.forms.fields.CharField object at 0x7f6c0e8e9cd0>), ('name', <django.forms.fields.CharField object at 0x7f6c0e8e9d10>), ('help_text', <django.forms.fields.CharField object at 0x7f6c0e8e9dd0>), ('initial', <django.forms.fields.IntegerField object at 0x7f6c0e8e9e90>), ('min_value', <django.forms.fields.IntegerField object at 0x7f6c0e8e9f50>), ('max_value', <django.forms.fields.IntegerField object at 0x7f6c0e038050>), ('required', <django.forms.fields.BooleanField object at 0x7f6c0e038110>), ('placeholder', <django.forms.fields.CharField object at 0x7f6c0e0381d0>)])
media
plugin_data_fields = [('label', ''), ('name', ''), ('help_text', ''), ('initial', ''), ('min_value', None), ('max_value', None), ('required', False), ('placeholder', '')]
Module contents
fobi.contrib.plugins.form_elements.fields.ip_address package
Submodules
fobi.contrib.plugins.form_elements.fields.ip_address.apps module
class fobi.contrib.plugins.form_elements.fields.ip_address.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

Config.

label = 'fobi_contrib_plugins_form_elements_fields_ip_address'
name = 'fobi.contrib.plugins.form_elements.fields.ip_address'
fobi.contrib.plugins.form_elements.fields.ip_address.base module
class fobi.contrib.plugins.form_elements.fields.ip_address.base.IPAddressInputPlugin(user=None)[source]

Bases: fobi.base.FormFieldPlugin

IP address field plugin.

form

alias of IPAddressInputForm

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
name = <django.utils.functional.__proxy__ object>
uid = 'ip_address'
fobi.contrib.plugins.form_elements.fields.ip_address.fobi_form_elements module
class fobi.contrib.plugins.form_elements.fields.ip_address.fobi_form_elements.IPAddressInputPlugin(user=None)[source]

Bases: fobi.base.FormFieldPlugin

IP address field plugin.

form

alias of IPAddressInputForm

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
name = <django.utils.functional.__proxy__ object>
uid = 'ip_address'
fobi.contrib.plugins.form_elements.fields.ip_address.forms module
Module contents
fobi.contrib.plugins.form_elements.fields.null_boolean package
Submodules
fobi.contrib.plugins.form_elements.fields.null_boolean.apps module
class fobi.contrib.plugins.form_elements.fields.null_boolean.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

Config.

label = 'fobi_contrib_plugins_form_elements_fields_null_boolean'
name = 'fobi.contrib.plugins.form_elements.fields.null_boolean'
fobi.contrib.plugins.form_elements.fields.null_boolean.base module
class fobi.contrib.plugins.form_elements.fields.null_boolean.base.NullBooleanSelectPlugin(user=None)[source]

Bases: fobi.base.FormFieldPlugin

Null boolean select plugin.

form

alias of NullBooleanSelectForm

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
name = <django.utils.functional.__proxy__ object>
uid = 'null_boolean'
fobi.contrib.plugins.form_elements.fields.null_boolean.fobi_form_elements module
class fobi.contrib.plugins.form_elements.fields.null_boolean.fobi_form_elements.NullBooleanSelectPlugin(user=None)[source]

Bases: fobi.base.FormFieldPlugin

Null boolean select plugin.

form

alias of NullBooleanSelectForm

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
name = <django.utils.functional.__proxy__ object>
uid = 'null_boolean'
fobi.contrib.plugins.form_elements.fields.null_boolean.forms module
Module contents
fobi.contrib.plugins.form_elements.fields.password package
Submodules
fobi.contrib.plugins.form_elements.fields.password.apps module
class fobi.contrib.plugins.form_elements.fields.password.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

Config.

label = 'fobi_contrib_plugins_form_elements_fields_password'
name = 'fobi.contrib.plugins.form_elements.fields.password'
fobi.contrib.plugins.form_elements.fields.password.base module
class fobi.contrib.plugins.form_elements.fields.password.base.PasswordInputPlugin(user=None)[source]

Bases: fobi.base.FormFieldPlugin

Password field plugin.

form

alias of PasswordInputForm

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
name = <django.utils.functional.__proxy__ object>
uid = 'password'
fobi.contrib.plugins.form_elements.fields.password.fobi_form_elements module
class fobi.contrib.plugins.form_elements.fields.password.fobi_form_elements.PasswordInputPlugin(user=None)[source]

Bases: fobi.base.FormFieldPlugin

Password field plugin.

form

alias of PasswordInputForm

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
name = <django.utils.functional.__proxy__ object>
uid = 'password'
fobi.contrib.plugins.form_elements.fields.password.forms module
class fobi.contrib.plugins.form_elements.fields.password.forms.PasswordInputForm(data=None, files=None, auto_id=u'id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None)[source]

Bases: django.forms.forms.Form, fobi.base.BaseFormFieldPluginForm

Form for PasswordInputPlugin.

base_fields = OrderedDict([('label', <django.forms.fields.CharField object at 0x7f6c0e0229d0>), ('name', <django.forms.fields.CharField object at 0x7f6c0e022ad0>), ('help_text', <django.forms.fields.CharField object at 0x7f6c0e022b90>), ('initial', <django.forms.fields.CharField object at 0x7f6c0e022c50>), ('max_length', <django.forms.fields.IntegerField object at 0x7f6c0e022d50>), ('required', <django.forms.fields.BooleanField object at 0x7f6c0e022e10>), ('placeholder', <django.forms.fields.CharField object at 0x7f6c0e022ed0>)])
clean()[source]
declared_fields = OrderedDict([('label', <django.forms.fields.CharField object at 0x7f6c0e0229d0>), ('name', <django.forms.fields.CharField object at 0x7f6c0e022ad0>), ('help_text', <django.forms.fields.CharField object at 0x7f6c0e022b90>), ('initial', <django.forms.fields.CharField object at 0x7f6c0e022c50>), ('max_length', <django.forms.fields.IntegerField object at 0x7f6c0e022d50>), ('required', <django.forms.fields.BooleanField object at 0x7f6c0e022e10>), ('placeholder', <django.forms.fields.CharField object at 0x7f6c0e022ed0>)])
media
plugin_data_fields = [('label', ''), ('name', ''), ('help_text', ''), ('initial', ''), ('max_length', '255'), ('required', False), ('placeholder', '')]
Module contents
fobi.contrib.plugins.form_elements.fields.radio package
Submodules
fobi.contrib.plugins.form_elements.fields.radio.apps module
class fobi.contrib.plugins.form_elements.fields.radio.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

Config.

label = 'fobi_contrib_plugins_form_elements_fields_radio'
name = 'fobi.contrib.plugins.form_elements.fields.radio'
fobi.contrib.plugins.form_elements.fields.radio.base module
class fobi.contrib.plugins.form_elements.fields.radio.base.RadioInputPlugin(user=None)[source]

Bases: fobi.base.FormFieldPlugin

Radio field plugin.

form

alias of RadioInputForm

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
name = <django.utils.functional.__proxy__ object>
submit_plugin_form_data(form_entry, request, form, form_element_entries=None, **kwargs)[source]

Submit plugin form data/process.

Parameters:
  • form_entry (fobi.models.FormEntry) – Instance of fobi.models.FormEntry.
  • request (django.http.HttpRequest) –
  • form (django.forms.Form) –
uid = 'radio'
fobi.contrib.plugins.form_elements.fields.radio.conf module
fobi.contrib.plugins.form_elements.fields.radio.conf.get_setting(setting, override=None)[source]

Get setting.

Get a setting from fobi.contrib.plugins.form_elements.fields.radio conf module, falling back to the default.

If override is not None, it will be used instead of the setting.

Parameters:
  • setting – String with setting name
  • override – Value to use when no setting is available. Defaults to None.
Returns:

Setting value.

fobi.contrib.plugins.form_elements.fields.radio.defaults module
fobi.contrib.plugins.form_elements.fields.radio.fobi_form_elements module
class fobi.contrib.plugins.form_elements.fields.radio.fobi_form_elements.RadioInputPlugin(user=None)[source]

Bases: fobi.base.FormFieldPlugin

Radio field plugin.

form

alias of RadioInputForm

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
name = <django.utils.functional.__proxy__ object>
submit_plugin_form_data(form_entry, request, form, form_element_entries=None, **kwargs)[source]

Submit plugin form data/process.

Parameters:
  • form_entry (fobi.models.FormEntry) – Instance of fobi.models.FormEntry.
  • request (django.http.HttpRequest) –
  • form (django.forms.Form) –
uid = 'radio'
fobi.contrib.plugins.form_elements.fields.radio.forms module
class fobi.contrib.plugins.form_elements.fields.radio.forms.RadioInputForm(data=None, files=None, auto_id=u'id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None)[source]

Bases: django.forms.forms.Form, fobi.base.BaseFormFieldPluginForm

Form for RadioInputPlugin.

base_fields = OrderedDict([('label', <django.forms.fields.CharField object at 0x7f6c0e022390>), ('name', <django.forms.fields.CharField object at 0x7f6c0e022490>), ('choices', <django.forms.fields.CharField object at 0x7f6c0e022590>), ('help_text', <django.forms.fields.CharField object at 0x7f6c0e022650>), ('initial', <django.forms.fields.CharField object at 0x7f6c0e022710>), ('required', <django.forms.fields.BooleanField object at 0x7f6c0e0227d0>)])
clean_initial()[source]

Validating the initial value.

declared_fields = OrderedDict([('label', <django.forms.fields.CharField object at 0x7f6c0e022390>), ('name', <django.forms.fields.CharField object at 0x7f6c0e022490>), ('choices', <django.forms.fields.CharField object at 0x7f6c0e022590>), ('help_text', <django.forms.fields.CharField object at 0x7f6c0e022650>), ('initial', <django.forms.fields.CharField object at 0x7f6c0e022710>), ('required', <django.forms.fields.BooleanField object at 0x7f6c0e0227d0>)])
media
plugin_data_fields = [('label', ''), ('name', ''), ('choices', ''), ('help_text', ''), ('initial', ''), ('required', False)]
fobi.contrib.plugins.form_elements.fields.radio.settings module
Module contents
fobi.contrib.plugins.form_elements.fields.range_select package
Submodules
fobi.contrib.plugins.form_elements.fields.range_select.apps module
class fobi.contrib.plugins.form_elements.fields.range_select.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

Config.

label = 'fobi_contrib_plugins_form_elements_fields_range_select'
name = 'fobi.contrib.plugins.form_elements.fields.range_select'
fobi.contrib.plugins.form_elements.fields.range_select.base module
class fobi.contrib.plugins.form_elements.fields.range_select.base.RangeSelectInputPlugin(user=None)[source]

Bases: fobi.base.FormFieldPlugin

Range select input plugin.

form

alias of RangeSelectInputForm

get_choices()[source]

Get choices.

Might be used in integration plugins.

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

get_initial()[source]

Get initial value.

Might be used in integration plugins.

group = <django.utils.functional.__proxy__ object>
name = <django.utils.functional.__proxy__ object>
uid = 'range_select'
fobi.contrib.plugins.form_elements.fields.range_select.conf module
fobi.contrib.plugins.form_elements.fields.range_select.conf.get_setting(setting, override=None)[source]

Get setting.

Get a setting from fobi.contrib.plugins.form_elements.fields.range_select conf module, falling back to the default.

If override is not None, it will be used instead of the setting.

Parameters:
  • setting – String with setting name
  • override – Value to use when no setting is available. Defaults to None.
Returns:

Setting value.

fobi.contrib.plugins.form_elements.fields.range_select.defaults module
fobi.contrib.plugins.form_elements.fields.range_select.fobi_form_elements module
class fobi.contrib.plugins.form_elements.fields.range_select.fobi_form_elements.RangeSelectInputPlugin(user=None)[source]

Bases: fobi.base.FormFieldPlugin

Range select input plugin.

form

alias of RangeSelectInputForm

get_choices()[source]

Get choices.

Might be used in integration plugins.

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

get_initial()[source]

Get initial value.

Might be used in integration plugins.

group = <django.utils.functional.__proxy__ object>
name = <django.utils.functional.__proxy__ object>
uid = 'range_select'
fobi.contrib.plugins.form_elements.fields.range_select.forms module
class fobi.contrib.plugins.form_elements.fields.range_select.forms.RangeSelectInputForm(data=None, files=None, auto_id=u'id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None)[source]

Bases: django.forms.forms.Form, fobi.base.BaseFormFieldPluginForm

Form for RangeSelectInputPlugin.

base_fields = OrderedDict([('label', <django.forms.fields.CharField object at 0x7f6c0e016b50>), ('name', <django.forms.fields.CharField object at 0x7f6c0e016b90>), ('min_value', <django.forms.fields.IntegerField object at 0x7f6c0e016c50>), ('max_value', <django.forms.fields.IntegerField object at 0x7f6c0e016d90>), ('step', <django.forms.fields.IntegerField object at 0x7f6c0e016f10>), ('help_text', <django.forms.fields.CharField object at 0x7f6c0e022090>), ('initial', <django.forms.fields.IntegerField object at 0x7f6c0e022150>), ('required', <django.forms.fields.BooleanField object at 0x7f6c0e022290>)])
clean()[source]

Validating the values.

declared_fields = OrderedDict([('label', <django.forms.fields.CharField object at 0x7f6c0e016b50>), ('name', <django.forms.fields.CharField object at 0x7f6c0e016b90>), ('min_value', <django.forms.fields.IntegerField object at 0x7f6c0e016c50>), ('max_value', <django.forms.fields.IntegerField object at 0x7f6c0e016d90>), ('step', <django.forms.fields.IntegerField object at 0x7f6c0e016f10>), ('help_text', <django.forms.fields.CharField object at 0x7f6c0e022090>), ('initial', <django.forms.fields.IntegerField object at 0x7f6c0e022150>), ('required', <django.forms.fields.BooleanField object at 0x7f6c0e022290>)])
media
plugin_data_fields = [('label', ''), ('name', ''), ('min_value', 0), ('max_value', 100), ('step', 1), ('help_text', ''), ('initial', 50), ('required', False)]
fobi.contrib.plugins.form_elements.fields.range_select.settings module
Module contents
fobi.contrib.plugins.form_elements.fields.regex package
Submodules
fobi.contrib.plugins.form_elements.fields.regex.apps module
class fobi.contrib.plugins.form_elements.fields.regex.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

Config.

label = 'fobi_contrib_plugins_form_elements_fields_regex'
name = 'fobi.contrib.plugins.form_elements.fields.regex'
fobi.contrib.plugins.form_elements.fields.regex.base module
class fobi.contrib.plugins.form_elements.fields.regex.base.RegexInputPlugin(user=None)[source]

Bases: fobi.base.FormFieldPlugin

Regex field plugin.

form

alias of RegexInputForm

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
name = <django.utils.functional.__proxy__ object>
uid = 'regex'
fobi.contrib.plugins.form_elements.fields.regex.fobi_form_elements module
class fobi.contrib.plugins.form_elements.fields.regex.fobi_form_elements.RegexInputPlugin(user=None)[source]

Bases: fobi.base.FormFieldPlugin

Regex field plugin.

form

alias of RegexInputForm

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
name = <django.utils.functional.__proxy__ object>
uid = 'regex'
fobi.contrib.plugins.form_elements.fields.regex.forms module
class fobi.contrib.plugins.form_elements.fields.regex.forms.RegexInputForm(data=None, files=None, auto_id=u'id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None)[source]

Bases: django.forms.forms.Form, fobi.base.BaseFormFieldPluginForm

Form for RegexInputPlugin.

base_fields = OrderedDict([('label', <django.forms.fields.CharField object at 0x7f6c0e016350>), ('name', <django.forms.fields.CharField object at 0x7f6c0e016450>), ('help_text', <django.forms.fields.CharField object at 0x7f6c0e016510>), ('regex', <django.forms.fields.RegexField object at 0x7f6c0e016610>), ('initial', <django.forms.fields.CharField object at 0x7f6c0e016750>), ('max_length', <django.forms.fields.IntegerField object at 0x7f6c0e016850>), ('required', <django.forms.fields.BooleanField object at 0x7f6c0e016910>), ('placeholder', <django.forms.fields.CharField object at 0x7f6c0e0169d0>)])
clean()[source]

Validation.

declared_fields = OrderedDict([('label', <django.forms.fields.CharField object at 0x7f6c0e016350>), ('name', <django.forms.fields.CharField object at 0x7f6c0e016450>), ('help_text', <django.forms.fields.CharField object at 0x7f6c0e016510>), ('regex', <django.forms.fields.RegexField object at 0x7f6c0e016610>), ('initial', <django.forms.fields.CharField object at 0x7f6c0e016750>), ('max_length', <django.forms.fields.IntegerField object at 0x7f6c0e016850>), ('required', <django.forms.fields.BooleanField object at 0x7f6c0e016910>), ('placeholder', <django.forms.fields.CharField object at 0x7f6c0e0169d0>)])
media
plugin_data_fields = [('label', ''), ('name', ''), ('help_text', ''), ('initial', ''), ('regex', ''), ('max_length', '255'), ('required', False), ('placeholder', '')]
Module contents
fobi.contrib.plugins.form_elements.fields.select package
Submodules
fobi.contrib.plugins.form_elements.fields.select.apps module
class fobi.contrib.plugins.form_elements.fields.select.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

Config.

label = 'fobi_contrib_plugins_form_elements_fields_select'
name = 'fobi.contrib.plugins.form_elements.fields.select'
fobi.contrib.plugins.form_elements.fields.select.base module
class fobi.contrib.plugins.form_elements.fields.select.base.SelectInputPlugin(user=None)[source]

Bases: fobi.base.FormFieldPlugin

Select field plugin.

form

alias of SelectInputForm

get_choices()[source]

Get choices.

Might be used in integration plugins.

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
name = <django.utils.functional.__proxy__ object>
submit_plugin_form_data(form_entry, request, form, form_element_entries=None, **kwargs)[source]

Submit plugin form data/process.

Parameters:
  • form_entry (fobi.models.FormEntry) – Instance of fobi.models.FormEntry.
  • request (django.http.HttpRequest) –
  • form (django.forms.Form) –
uid = 'select'
fobi.contrib.plugins.form_elements.fields.select.conf module
fobi.contrib.plugins.form_elements.fields.select.conf.get_setting(setting, override=None)[source]

Get setting.

Get a setting from fobi.contrib.plugins.form_elements.fields.select conf module, falling back to the default.

If override is not None, it will be used instead of the setting.

Parameters:
  • setting – String with setting name
  • override – Value to use when no setting is available. Defaults to None.
Returns:

Setting value.

fobi.contrib.plugins.form_elements.fields.select.defaults module
fobi.contrib.plugins.form_elements.fields.select.fobi_form_elements module
class fobi.contrib.plugins.form_elements.fields.select.fobi_form_elements.SelectInputPlugin(user=None)[source]

Bases: fobi.base.FormFieldPlugin

Select field plugin.

form

alias of SelectInputForm

get_choices()[source]

Get choices.

Might be used in integration plugins.

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
name = <django.utils.functional.__proxy__ object>
submit_plugin_form_data(form_entry, request, form, form_element_entries=None, **kwargs)[source]

Submit plugin form data/process.

Parameters:
  • form_entry (fobi.models.FormEntry) – Instance of fobi.models.FormEntry.
  • request (django.http.HttpRequest) –
  • form (django.forms.Form) –
uid = 'select'
fobi.contrib.plugins.form_elements.fields.select.forms module
class fobi.contrib.plugins.form_elements.fields.select.forms.SelectInputForm(data=None, files=None, auto_id=u'id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None)[source]

Bases: django.forms.forms.Form, fobi.base.BaseFormFieldPluginForm

Form for SelectInputPlugin.

base_fields = OrderedDict([('label', <django.forms.fields.CharField object at 0x7f6c0e007dd0>), ('name', <django.forms.fields.CharField object at 0x7f6c0e007e10>), ('choices', <django.forms.fields.CharField object at 0x7f6c0e007f10>), ('help_text', <django.forms.fields.CharField object at 0x7f6c0e007fd0>), ('initial', <django.forms.fields.CharField object at 0x7f6c0e0160d0>), ('required', <django.forms.fields.BooleanField object at 0x7f6c0e016190>)])
clean_initial()[source]

Validating the initial value.

declared_fields = OrderedDict([('label', <django.forms.fields.CharField object at 0x7f6c0e007dd0>), ('name', <django.forms.fields.CharField object at 0x7f6c0e007e10>), ('choices', <django.forms.fields.CharField object at 0x7f6c0e007f10>), ('help_text', <django.forms.fields.CharField object at 0x7f6c0e007fd0>), ('initial', <django.forms.fields.CharField object at 0x7f6c0e0160d0>), ('required', <django.forms.fields.BooleanField object at 0x7f6c0e016190>)])
media
plugin_data_fields = [('label', ''), ('name', ''), ('choices', ''), ('help_text', ''), ('initial', ''), ('required', False)]
fobi.contrib.plugins.form_elements.fields.select.settings module
Module contents
fobi.contrib.plugins.form_elements.fields.select_model_object package
Submodules
fobi.contrib.plugins.form_elements.fields.select_model_object.apps module
class fobi.contrib.plugins.form_elements.fields.select_model_object.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

Config.

label = 'fobi_contrib_plugins_form_elements_fields_select_model_object'
name = 'fobi.contrib.plugins.form_elements.fields.select_model_object'
fobi.contrib.plugins.form_elements.fields.select_model_object.base module
class fobi.contrib.plugins.form_elements.fields.select_model_object.base.SelectModelObjectInputPlugin(user=None)[source]

Bases: fobi.base.FormFieldPlugin

Select model object field plugin.

form

alias of SelectModelObjectInputForm

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

get_queryset()[source]

Get queryset.

Might be used in integration packages.

group = <django.utils.functional.__proxy__ object>
name = <django.utils.functional.__proxy__ object>
prepare_plugin_form_data(cleaned_data)[source]

Prepare plugin form data.

Might be used in integration plugins.

submit_plugin_form_data(form_entry, request, form, form_element_entries=None, **kwargs)[source]

Submit plugin form data/process.

Parameters:
  • form_entry (fobi.models.FormEntry) – Instance of fobi.models.FormEntry.
  • request (django.http.HttpRequest) –
  • form (django.forms.Form) –
uid = 'select_model_object'
fobi.contrib.plugins.form_elements.fields.select_model_object.conf module
fobi.contrib.plugins.form_elements.fields.select_model_object.conf.get_setting(setting, override=None)[source]

Get setting.

Get a setting from fobi.contrib.plugins.form_elements.fields.select_model_object conf module, falling back to the default.

If override is not None, it will be used instead of the setting.

Parameters:
  • setting – String with setting name
  • override – Value to use when no setting is available. Defaults to None.
Returns:

Setting value.

fobi.contrib.plugins.form_elements.fields.select_model_object.defaults module
fobi.contrib.plugins.form_elements.fields.select_model_object.fobi_form_elements module
class fobi.contrib.plugins.form_elements.fields.select_model_object.fobi_form_elements.SelectModelObjectInputPlugin(user=None)[source]

Bases: fobi.base.FormFieldPlugin

Select model object field plugin.

form

alias of SelectModelObjectInputForm

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

get_queryset()[source]

Get queryset.

Might be used in integration packages.

group = <django.utils.functional.__proxy__ object>
name = <django.utils.functional.__proxy__ object>
prepare_plugin_form_data(cleaned_data)[source]

Prepare plugin form data.

Might be used in integration plugins.

submit_plugin_form_data(form_entry, request, form, form_element_entries=None, **kwargs)[source]

Submit plugin form data/process.

Parameters:
  • form_entry (fobi.models.FormEntry) – Instance of fobi.models.FormEntry.
  • request (django.http.HttpRequest) –
  • form (django.forms.Form) –
uid = 'select_model_object'
fobi.contrib.plugins.form_elements.fields.select_model_object.forms module
class fobi.contrib.plugins.form_elements.fields.select_model_object.forms.SelectModelObjectInputForm(*args, **kwargs)[source]

Bases: django.forms.forms.Form, fobi.base.BaseFormFieldPluginForm

Form for SelectModelObjectPlugin.

base_fields = OrderedDict([('label', <django.forms.fields.CharField object at 0x7f6c0e007910>), ('name', <django.forms.fields.CharField object at 0x7f6c0e007950>), ('model', <django.forms.fields.ChoiceField object at 0x7f6c0e007a10>), ('help_text', <django.forms.fields.CharField object at 0x7f6c0e007ad0>), ('initial', <django.forms.fields.CharField object at 0x7f6c0e007b90>), ('required', <django.forms.fields.BooleanField object at 0x7f6c0e007c50>)])
declared_fields = OrderedDict([('label', <django.forms.fields.CharField object at 0x7f6c0e007910>), ('name', <django.forms.fields.CharField object at 0x7f6c0e007950>), ('model', <django.forms.fields.ChoiceField object at 0x7f6c0e007a10>), ('help_text', <django.forms.fields.CharField object at 0x7f6c0e007ad0>), ('initial', <django.forms.fields.CharField object at 0x7f6c0e007b90>), ('required', <django.forms.fields.BooleanField object at 0x7f6c0e007c50>)])
media
plugin_data_fields = [('label', ''), ('name', ''), ('model', ''), ('help_text', ''), ('initial', ''), ('required', False)]
fobi.contrib.plugins.form_elements.fields.select_model_object.settings module
Module contents
fobi.contrib.plugins.form_elements.fields.select_mptt_model_object package
Submodules
fobi.contrib.plugins.form_elements.fields.select_mptt_model_object.apps module
class fobi.contrib.plugins.form_elements.fields.select_mptt_model_object.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

Config.

label = 'fobi_contrib_plugins_form_elements_fields_select_mptt_model_object'
name = 'fobi.contrib.plugins.form_elements.fields.select_mptt_model_object'
fobi.contrib.plugins.form_elements.fields.select_mptt_model_object.base module
fobi.contrib.plugins.form_elements.fields.select_mptt_model_object.conf module
fobi.contrib.plugins.form_elements.fields.select_mptt_model_object.conf.get_setting(setting, override=None)[source]

Get setting.

Get a setting from fobi.contrib.plugins.form_elements.fields.select_mptt_model_object conf module, falling back to the default.

If override is not None, it will be used instead of the setting.

Parameters:
  • setting – String with setting name
  • override – Value to use when no setting is available. Defaults to None.
Returns:

Setting value.

fobi.contrib.plugins.form_elements.fields.select_mptt_model_object.defaults module
fobi.contrib.plugins.form_elements.fields.select_mptt_model_object.fobi_form_elements module
fobi.contrib.plugins.form_elements.fields.select_mptt_model_object.forms module
class fobi.contrib.plugins.form_elements.fields.select_mptt_model_object.forms.SelectMPTTModelObjectInputForm(*args, **kwargs)[source]

Bases: django.forms.forms.Form, fobi.base.BaseFormFieldPluginForm

Form for SelectMPTTModelObjectPlugin.

base_fields = OrderedDict([('label', <django.forms.fields.CharField object at 0x7f6c087380d0>), ('name', <django.forms.fields.CharField object at 0x7f6c08738110>), ('model', <django.forms.fields.ChoiceField object at 0x7f6c09e87a50>), ('help_text', <django.forms.fields.CharField object at 0x7f6c08738250>), ('initial', <django.forms.fields.CharField object at 0x7f6c08738310>), ('required', <django.forms.fields.BooleanField object at 0x7f6c08738350>)])
declared_fields = OrderedDict([('label', <django.forms.fields.CharField object at 0x7f6c087380d0>), ('name', <django.forms.fields.CharField object at 0x7f6c08738110>), ('model', <django.forms.fields.ChoiceField object at 0x7f6c09e87a50>), ('help_text', <django.forms.fields.CharField object at 0x7f6c08738250>), ('initial', <django.forms.fields.CharField object at 0x7f6c08738310>), ('required', <django.forms.fields.BooleanField object at 0x7f6c08738350>)])
media
plugin_data_fields = [('label', ''), ('name', ''), ('model', ''), ('help_text', ''), ('initial', ''), ('required', False)]
fobi.contrib.plugins.form_elements.fields.select_mptt_model_object.settings module
Module contents
fobi.contrib.plugins.form_elements.fields.select_multiple package
Submodules
fobi.contrib.plugins.form_elements.fields.select_multiple.apps module
class fobi.contrib.plugins.form_elements.fields.select_multiple.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

Config.

label = 'fobi_contrib_plugins_form_elements_fields_select_multiple'
name = 'fobi.contrib.plugins.form_elements.fields.select_multiple'
fobi.contrib.plugins.form_elements.fields.select_multiple.base module
class fobi.contrib.plugins.form_elements.fields.select_multiple.base.SelectMultipleInputPlugin(user=None)[source]

Bases: fobi.base.FormFieldPlugin

Select multiple field plugin.

form

alias of SelectMultipleInputForm

get_choices()[source]

Get choices.

Might be used in integration plugins.

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
name = <django.utils.functional.__proxy__ object>
prepare_plugin_form_data(cleaned_data)[source]

Prepare plugin form data.

Might be used in integration plugins.

submit_plugin_form_data(form_entry, request, form, form_element_entries=None, **kwargs)[source]

Submit plugin form data/process.

Parameters:
  • form_entry (fobi.models.FormEntry) – Instance of fobi.models.FormEntry.
  • request (django.http.HttpRequest) –
  • form (django.forms.Form) –
uid = 'select_multiple'
fobi.contrib.plugins.form_elements.fields.select_multiple.conf module
fobi.contrib.plugins.form_elements.fields.select_multiple.conf.get_setting(setting, override=None)[source]

Get setting.

Get a setting from fobi.contrib.plugins.form_elements.fields.select_multiple conf module, falling back to the default.

If override is not None, it will be used instead of the setting.

Parameters:
  • setting – String with setting name
  • override – Value to use when no setting is available. Defaults to None.
Returns:

Setting value.

fobi.contrib.plugins.form_elements.fields.select_multiple.defaults module
fobi.contrib.plugins.form_elements.fields.select_multiple.fobi_form_elements module
class fobi.contrib.plugins.form_elements.fields.select_multiple.fobi_form_elements.SelectMultipleInputPlugin(user=None)[source]

Bases: fobi.base.FormFieldPlugin

Select multiple field plugin.

form

alias of SelectMultipleInputForm

get_choices()[source]

Get choices.

Might be used in integration plugins.

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
name = <django.utils.functional.__proxy__ object>
prepare_plugin_form_data(cleaned_data)[source]

Prepare plugin form data.

Might be used in integration plugins.

submit_plugin_form_data(form_entry, request, form, form_element_entries=None, **kwargs)[source]

Submit plugin form data/process.

Parameters:
  • form_entry (fobi.models.FormEntry) – Instance of fobi.models.FormEntry.
  • request (django.http.HttpRequest) –
  • form (django.forms.Form) –
uid = 'select_multiple'
fobi.contrib.plugins.form_elements.fields.select_multiple.forms module
class fobi.contrib.plugins.form_elements.fields.select_multiple.forms.SelectMultipleInputForm(data=None, files=None, auto_id=u'id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None)[source]

Bases: django.forms.forms.Form, fobi.base.BaseFormFieldPluginForm

Form for SelectMultipleInputPlugin.

base_fields = OrderedDict([('label', <django.forms.fields.CharField object at 0x7f6c0e007350>), ('name', <django.forms.fields.CharField object at 0x7f6c0e007390>), ('choices', <django.forms.fields.CharField object at 0x7f6c0e007490>), ('help_text', <django.forms.fields.CharField object at 0x7f6c0e007550>), ('initial', <django.forms.fields.CharField object at 0x7f6c0e007610>), ('required', <django.forms.fields.BooleanField object at 0x7f6c0e0076d0>)])
clean_initial()[source]

Validating the initial value.

declared_fields = OrderedDict([('label', <django.forms.fields.CharField object at 0x7f6c0e007350>), ('name', <django.forms.fields.CharField object at 0x7f6c0e007390>), ('choices', <django.forms.fields.CharField object at 0x7f6c0e007490>), ('help_text', <django.forms.fields.CharField object at 0x7f6c0e007550>), ('initial', <django.forms.fields.CharField object at 0x7f6c0e007610>), ('required', <django.forms.fields.BooleanField object at 0x7f6c0e0076d0>)])
media
plugin_data_fields = [('label', ''), ('name', ''), ('choices', ''), ('help_text', ''), ('initial', ''), ('required', False)]
fobi.contrib.plugins.form_elements.fields.select_multiple.settings module
Module contents
fobi.contrib.plugins.form_elements.fields.select_multiple_model_objects package
Submodules
fobi.contrib.plugins.form_elements.fields.select_multiple_model_objects.apps module
class fobi.contrib.plugins.form_elements.fields.select_multiple_model_objects.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

Config.

label = 'fobi_contrib_plugins_form_elements_fields_select_multiple_model_objects'
name = 'fobi.contrib.plugins.form_elements.fields.select_multiple_model_objects'
fobi.contrib.plugins.form_elements.fields.select_multiple_model_objects.base module
class fobi.contrib.plugins.form_elements.fields.select_multiple_model_objects.base.SelectMultipleModelObjectsInputPlugin(user=None)[source]

Bases: fobi.base.FormFieldPlugin

Select multiple model objects field plugin.

form

alias of SelectMultipleModelObjectsInputForm

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

get_queryset()[source]

Get queryset.

Might be used in integration packages.

group = <django.utils.functional.__proxy__ object>
name = <django.utils.functional.__proxy__ object>
submit_plugin_form_data(form_entry, request, form, form_element_entries=None, **kwargs)[source]

Submit plugin form data/process.

Parameters:
  • form_entry (fobi.models.FormEntry) – Instance of fobi.models.FormEntry.
  • request (django.http.HttpRequest) –
  • form (django.forms.Form) –
uid = 'select_multiple_model_objects'
fobi.contrib.plugins.form_elements.fields.select_multiple_model_objects.conf module
fobi.contrib.plugins.form_elements.fields.select_multiple_model_objects.conf.get_setting(setting, override=None)[source]

Get setting.

Get a setting from fobi.contrib.plugins.form_elements.fields.select_multiple_model_objects conf module, falling back to the default.

If override is not None, it will be used instead of the setting.

Parameters:
  • setting – String with setting name
  • override – Value to use when no setting is available. Defaults to None.
Returns:

Setting value.

fobi.contrib.plugins.form_elements.fields.select_multiple_model_objects.defaults module
fobi.contrib.plugins.form_elements.fields.select_multiple_model_objects.fobi_form_elements module
class fobi.contrib.plugins.form_elements.fields.select_multiple_model_objects.fobi_form_elements.SelectMultipleModelObjectsInputPlugin(user=None)[source]

Bases: fobi.base.FormFieldPlugin

Select multiple model objects field plugin.

form

alias of SelectMultipleModelObjectsInputForm

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

get_queryset()[source]

Get queryset.

Might be used in integration packages.

group = <django.utils.functional.__proxy__ object>
name = <django.utils.functional.__proxy__ object>
submit_plugin_form_data(form_entry, request, form, form_element_entries=None, **kwargs)[source]

Submit plugin form data/process.

Parameters:
  • form_entry (fobi.models.FormEntry) – Instance of fobi.models.FormEntry.
  • request (django.http.HttpRequest) –
  • form (django.forms.Form) –
uid = 'select_multiple_model_objects'
fobi.contrib.plugins.form_elements.fields.select_multiple_model_objects.forms module
class fobi.contrib.plugins.form_elements.fields.select_multiple_model_objects.forms.SelectMultipleModelObjectsInputForm(*args, **kwargs)[source]

Bases: django.forms.forms.Form, fobi.base.BaseFormFieldPluginForm

Form for SelectMultipleModelObjectsPlugin.

base_fields = OrderedDict([('label', <django.forms.fields.CharField object at 0x7f6c0e89b210>), ('name', <django.forms.fields.CharField object at 0x7f6c0dffc7d0>), ('model', <django.forms.fields.ChoiceField object at 0x7f6c0dffc890>), ('help_text', <django.forms.fields.CharField object at 0x7f6c0dffc950>), ('initial', <django.forms.fields.CharField object at 0x7f6c0dffca10>), ('required', <django.forms.fields.BooleanField object at 0x7f6c0dffcad0>)])
declared_fields = OrderedDict([('label', <django.forms.fields.CharField object at 0x7f6c0e89b210>), ('name', <django.forms.fields.CharField object at 0x7f6c0dffc7d0>), ('model', <django.forms.fields.ChoiceField object at 0x7f6c0dffc890>), ('help_text', <django.forms.fields.CharField object at 0x7f6c0dffc950>), ('initial', <django.forms.fields.CharField object at 0x7f6c0dffca10>), ('required', <django.forms.fields.BooleanField object at 0x7f6c0dffcad0>)])
media
plugin_data_fields = [('label', ''), ('name', ''), ('model', ''), ('help_text', ''), ('initial', ''), ('required', False)]
fobi.contrib.plugins.form_elements.fields.select_multiple_model_objects.settings module
Module contents
fobi.contrib.plugins.form_elements.fields.select_multiple_mptt_model_objects package
Submodules
fobi.contrib.plugins.form_elements.fields.select_multiple_mptt_model_objects.apps module
class fobi.contrib.plugins.form_elements.fields.select_multiple_mptt_model_objects.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

Config.

label = 'fobi_contrib_plugins_form_elements_fields_select_multiple_mptt_model_objects'
name = 'fobi.contrib.plugins.form_elements.fields.select_multiple_mptt_model_objects'
fobi.contrib.plugins.form_elements.fields.select_multiple_mptt_model_objects.base module
fobi.contrib.plugins.form_elements.fields.select_multiple_mptt_model_objects.conf module
fobi.contrib.plugins.form_elements.fields.select_multiple_mptt_model_objects.conf.get_setting(setting, override=None)[source]

Get a setting from fobi.contrib.plugins.form_elements.fields.select_multiple_mptt_model_ objects conf module, falling back to the default.

If override is not None, it will be used instead of the setting.

Parameters:
  • setting – String with setting name
  • override – Value to use when no setting is available. Defaults to None.
Returns:

Setting value.

fobi.contrib.plugins.form_elements.fields.select_multiple_mptt_model_objects.defaults module
fobi.contrib.plugins.form_elements.fields.select_multiple_mptt_model_objects.fobi_form_elements module
fobi.contrib.plugins.form_elements.fields.select_multiple_mptt_model_objects.forms module
class fobi.contrib.plugins.form_elements.fields.select_multiple_mptt_model_objects.forms.SelectMultipleMPTTModelObjectsInputForm(*args, **kwargs)[source]

Bases: django.forms.forms.Form, fobi.base.BaseFormFieldPluginForm

Form for SelectMultipleMPTTModelObjectsPlugin.

base_fields = OrderedDict([('label', <django.forms.fields.CharField object at 0x7f6c0a493990>), ('name', <django.forms.fields.CharField object at 0x7f6c08e058d0>), ('model', <django.forms.fields.ChoiceField object at 0x7f6c08e05b10>), ('help_text', <django.forms.fields.CharField object at 0x7f6c08e05710>), ('initial', <django.forms.fields.CharField object at 0x7f6c08e05850>), ('required', <django.forms.fields.BooleanField object at 0x7f6c08e05d10>)])
declared_fields = OrderedDict([('label', <django.forms.fields.CharField object at 0x7f6c0a493990>), ('name', <django.forms.fields.CharField object at 0x7f6c08e058d0>), ('model', <django.forms.fields.ChoiceField object at 0x7f6c08e05b10>), ('help_text', <django.forms.fields.CharField object at 0x7f6c08e05710>), ('initial', <django.forms.fields.CharField object at 0x7f6c08e05850>), ('required', <django.forms.fields.BooleanField object at 0x7f6c08e05d10>)])
media
plugin_data_fields = [('label', ''), ('name', ''), ('model', ''), ('help_text', ''), ('initial', ''), ('required', False)]
fobi.contrib.plugins.form_elements.fields.select_multiple_mptt_model_objects.settings module
Module contents
fobi.contrib.plugins.form_elements.fields.select_multiple_with_max package
Submodules
fobi.contrib.plugins.form_elements.fields.select_multiple_with_max.apps module
class fobi.contrib.plugins.form_elements.fields.select_multiple_with_max.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

Config.

label = 'fobi_contrib_plugins_form_elements_fields_select_multiple_with_max'
name = 'fobi.contrib.plugins.form_elements.fields.select_multiple_with_max'
fobi.contrib.plugins.form_elements.fields.select_multiple_with_max.base module
class fobi.contrib.plugins.form_elements.fields.select_multiple_with_max.base.SelectMultipleWithMaxInputPlugin(user=None)[source]

Bases: fobi.base.FormFieldPlugin

Select multiple with max field plugin.

form

alias of SelectMultipleWithMaxInputForm

get_choices()[source]

Get choices.

Might be used in integration plugins.

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
name = <django.utils.functional.__proxy__ object>
prepare_plugin_form_data(cleaned_data)[source]

Prepare plugin form data.

Might be used in integration plugins.

submit_plugin_form_data(form_entry, request, form, form_element_entries=None, **kwargs)[source]

Submit plugin form data/process.

Parameters:
  • form_entry (fobi.models.FormEntry) – Instance of fobi.models.FormEntry.
  • request (django.http.HttpRequest) –
  • form (django.forms.Form) –
uid = 'select_multiple_with_max'
fobi.contrib.plugins.form_elements.fields.select_multiple_with_max.conf module
fobi.contrib.plugins.form_elements.fields.select_multiple_with_max.conf.get_setting(setting, override=None)[source]

Get setting.

Get a setting from fobi.contrib.plugins.form_elements.fields.select_multiple_with_max conf module, falling back to the default.

If override is not None, it will be used instead of the setting.

Parameters:
  • setting – String with setting name
  • override – Value to use when no setting is available. Defaults to None.
Returns:

Setting value.

fobi.contrib.plugins.form_elements.fields.select_multiple_with_max.defaults module
fobi.contrib.plugins.form_elements.fields.select_multiple_with_max.fields module
class fobi.contrib.plugins.form_elements.fields.select_multiple_with_max.fields.MultipleChoiceWithMaxField(max_choices=None, choices=(), required=True, widget=None, label=None, initial=None, help_text='', *args, **kwargs)[source]

Bases: django.forms.fields.MultipleChoiceField

Multiple choice with max field.

validate(value)[source]

Validate.

fobi.contrib.plugins.form_elements.fields.select_multiple_with_max.fobi_form_elements module
class fobi.contrib.plugins.form_elements.fields.select_multiple_with_max.fobi_form_elements.SelectMultipleWithMaxInputPlugin(user=None)[source]

Bases: fobi.base.FormFieldPlugin

Select multiple with max field plugin.

form

alias of SelectMultipleWithMaxInputForm

get_choices()[source]

Get choices.

Might be used in integration plugins.

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
name = <django.utils.functional.__proxy__ object>
prepare_plugin_form_data(cleaned_data)[source]

Prepare plugin form data.

Might be used in integration plugins.

submit_plugin_form_data(form_entry, request, form, form_element_entries=None, **kwargs)[source]

Submit plugin form data/process.

Parameters:
  • form_entry (fobi.models.FormEntry) – Instance of fobi.models.FormEntry.
  • request (django.http.HttpRequest) –
  • form (django.forms.Form) –
uid = 'select_multiple_with_max'
fobi.contrib.plugins.form_elements.fields.select_multiple_with_max.forms module
class fobi.contrib.plugins.form_elements.fields.select_multiple_with_max.forms.SelectMultipleWithMaxInputForm(data=None, files=None, auto_id=u'id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None)[source]

Bases: django.forms.forms.Form, fobi.base.BaseFormFieldPluginForm

Form for SelectMultipleWithMaxInputPlugin.

base_fields = OrderedDict([('label', <django.forms.fields.CharField object at 0x7f6c0dffcbd0>), ('name', <django.forms.fields.CharField object at 0x7f6c0dffccd0>), ('choices', <django.forms.fields.CharField object at 0x7f6c0dffcdd0>), ('help_text', <django.forms.fields.CharField object at 0x7f6c0dffce90>), ('initial', <django.forms.fields.CharField object at 0x7f6c0dffcf50>), ('required', <django.forms.fields.BooleanField object at 0x7f6c0e007050>), ('max_choices', <django.forms.fields.IntegerField object at 0x7f6c0e007110>)])
clean_initial()[source]

Validating the initial value.

declared_fields = OrderedDict([('label', <django.forms.fields.CharField object at 0x7f6c0dffcbd0>), ('name', <django.forms.fields.CharField object at 0x7f6c0dffccd0>), ('choices', <django.forms.fields.CharField object at 0x7f6c0dffcdd0>), ('help_text', <django.forms.fields.CharField object at 0x7f6c0dffce90>), ('initial', <django.forms.fields.CharField object at 0x7f6c0dffcf50>), ('required', <django.forms.fields.BooleanField object at 0x7f6c0e007050>), ('max_choices', <django.forms.fields.IntegerField object at 0x7f6c0e007110>)])
media
plugin_data_fields = [('label', ''), ('name', ''), ('choices', ''), ('help_text', ''), ('initial', ''), ('required', False), ('max_choices', '')]
fobi.contrib.plugins.form_elements.fields.select_multiple_with_max.settings module
Module contents
fobi.contrib.plugins.form_elements.fields.slider package
Submodules
fobi.contrib.plugins.form_elements.fields.slider.apps module
class fobi.contrib.plugins.form_elements.fields.slider.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

Config.

label = 'fobi_contrib_plugins_form_elements_fields_slider'
name = 'fobi.contrib.plugins.form_elements.fields.slider'
fobi.contrib.plugins.form_elements.fields.slider.base module
class fobi.contrib.plugins.form_elements.fields.slider.base.SliderInputPlugin(user=None)[source]

Bases: fobi.base.FormFieldPlugin

Slider field plugin.

form

alias of SliderInputForm

get_choices()[source]

Get choices.

Might be used in integration plugins.

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

get_initial()[source]

Get initial value.

Might be used in integration plugins.

group = <django.utils.functional.__proxy__ object>
html_classes = ['slider']
name = <django.utils.functional.__proxy__ object>
uid = 'slider'
fobi.contrib.plugins.form_elements.fields.slider.conf module
fobi.contrib.plugins.form_elements.fields.slider.conf.get_setting(setting, override=None)[source]

Get setting.

Get a setting from fobi.contrib.plugins.form_elements.fields.slider conf module, falling back to the default.

If override is not None, it will be used instead of the setting.

Parameters:
  • setting – String with setting name.
  • override – Value to use when no setting is available. Defaults to None.
Returns:

Setting value.

fobi.contrib.plugins.form_elements.fields.slider.constants module
fobi.contrib.plugins.form_elements.fields.slider.defaults module
fobi.contrib.plugins.form_elements.fields.slider.fobi_form_elements module
class fobi.contrib.plugins.form_elements.fields.slider.fobi_form_elements.SliderInputPlugin(user=None)[source]

Bases: fobi.base.FormFieldPlugin

Slider field plugin.

form

alias of SliderInputForm

get_choices()[source]

Get choices.

Might be used in integration plugins.

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

get_initial()[source]

Get initial value.

Might be used in integration plugins.

group = <django.utils.functional.__proxy__ object>
html_classes = ['slider']
name = <django.utils.functional.__proxy__ object>
uid = 'slider'
fobi.contrib.plugins.form_elements.fields.slider.forms module
class fobi.contrib.plugins.form_elements.fields.slider.forms.SliderInputForm(data=None, files=None, auto_id=u'id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None)[source]

Bases: django.forms.forms.Form, fobi.base.BaseFormFieldPluginForm

Form for SliderInputPlugin.

base_fields = OrderedDict([('label', <django.forms.fields.CharField object at 0x7f6c0e06f910>), ('name', <django.forms.fields.CharField object at 0x7f6c0e06f950>), ('initial', <django.forms.fields.IntegerField object at 0x7f6c0e06fa10>), ('min_value', <django.forms.fields.IntegerField object at 0x7f6c0e06fb50>), ('max_value', <django.forms.fields.IntegerField object at 0x7f6c0e06fc90>), ('step', <django.forms.fields.IntegerField object at 0x7f6c0e06fe10>), ('tooltip', <django.forms.fields.ChoiceField object at 0x7f6c0e06ff50>), ('handle', <django.forms.fields.ChoiceField object at 0x7f6c0dffc050>), ('show_endpoints_as', <django.forms.fields.ChoiceField object at 0x7f6c0dffc110>), ('label_start', <django.forms.fields.CharField object at 0x7f6c0dffc210>), ('label_end', <django.forms.fields.CharField object at 0x7f6c0dffc310>), ('custom_ticks', <django.forms.fields.CharField object at 0x7f6c0dffc410>), ('help_text', <django.forms.fields.CharField object at 0x7f6c0dffc4d0>), ('required', <django.forms.fields.BooleanField object at 0x7f6c0dffc590>)])
clean()[source]

Validating the values.

declared_fields = OrderedDict([('label', <django.forms.fields.CharField object at 0x7f6c0e06f910>), ('name', <django.forms.fields.CharField object at 0x7f6c0e06f950>), ('initial', <django.forms.fields.IntegerField object at 0x7f6c0e06fa10>), ('min_value', <django.forms.fields.IntegerField object at 0x7f6c0e06fb50>), ('max_value', <django.forms.fields.IntegerField object at 0x7f6c0e06fc90>), ('step', <django.forms.fields.IntegerField object at 0x7f6c0e06fe10>), ('tooltip', <django.forms.fields.ChoiceField object at 0x7f6c0e06ff50>), ('handle', <django.forms.fields.ChoiceField object at 0x7f6c0dffc050>), ('show_endpoints_as', <django.forms.fields.ChoiceField object at 0x7f6c0dffc110>), ('label_start', <django.forms.fields.CharField object at 0x7f6c0dffc210>), ('label_end', <django.forms.fields.CharField object at 0x7f6c0dffc310>), ('custom_ticks', <django.forms.fields.CharField object at 0x7f6c0dffc410>), ('help_text', <django.forms.fields.CharField object at 0x7f6c0dffc4d0>), ('required', <django.forms.fields.BooleanField object at 0x7f6c0dffc590>)])
media
plugin_data_fields = [('label', ''), ('name', ''), ('initial', 50), ('min_value', 0), ('max_value', 100), ('step', 1), ('tooltip', 'show'), ('handle', 'round'), ('show_endpoints_as', 'labels'), ('label_start', ''), ('label_end', ''), ('custom_ticks', ''), ('help_text', ''), ('required', False)]
fobi.contrib.plugins.form_elements.fields.slider.helpers module
fobi.contrib.plugins.form_elements.fields.slider.helpers.generate_ticks(choices, empty_labels=False)[source]

Generate ticks.

Parameters:
  • choices (iterable) – Iterable of tuples or lists:
  • empty_labels (bool) –
Return dict:
fobi.contrib.plugins.form_elements.fields.slider.settings module
fobi.contrib.plugins.form_elements.fields.slider.widgets module
class fobi.contrib.plugins.form_elements.fields.slider.widgets.BaseSliderPluginWidget(plugin)[source]

Bases: fobi.base.FormElementPluginWidget

Base date form element plugin widget.

html_classes = ['slider']
plugin_uid = 'slider'
Module contents
fobi.contrib.plugins.form_elements.fields.slug package
Submodules
fobi.contrib.plugins.form_elements.fields.slug.apps module
class fobi.contrib.plugins.form_elements.fields.slug.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

Config.

label = 'fobi_contrib_plugins_form_elements_fields_slug'
name = 'fobi.contrib.plugins.form_elements.fields.slug'
fobi.contrib.plugins.form_elements.fields.slug.base module
class fobi.contrib.plugins.form_elements.fields.slug.base.SlugInputPlugin(user=None)[source]

Bases: fobi.base.FormFieldPlugin

Slug field plugin.

form

alias of SlugInputForm

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
name = <django.utils.functional.__proxy__ object>
uid = 'slug'
fobi.contrib.plugins.form_elements.fields.slug.fobi_form_elements module
class fobi.contrib.plugins.form_elements.fields.slug.fobi_form_elements.SlugInputPlugin(user=None)[source]

Bases: fobi.base.FormFieldPlugin

Slug field plugin.

form

alias of SlugInputForm

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
name = <django.utils.functional.__proxy__ object>
uid = 'slug'
fobi.contrib.plugins.form_elements.fields.slug.forms module
class fobi.contrib.plugins.form_elements.fields.slug.forms.SlugInputForm(data=None, files=None, auto_id=u'id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None)[source]

Bases: django.forms.forms.Form, fobi.base.BaseFormFieldPluginForm

Form for SlugInputPlugin.

base_fields = OrderedDict([('label', <django.forms.fields.CharField object at 0x7f6c0e06f350>), ('name', <django.forms.fields.CharField object at 0x7f6c0e06f390>), ('help_text', <django.forms.fields.CharField object at 0x7f6c0e06f450>), ('initial', <django.forms.fields.SlugField object at 0x7f6c0e06f510>), ('max_length', <django.forms.fields.IntegerField object at 0x7f6c0e06f610>), ('required', <django.forms.fields.BooleanField object at 0x7f6c0e06f6d0>), ('placeholder', <django.forms.fields.CharField object at 0x7f6c0e06f790>)])
clean()[source]
declared_fields = OrderedDict([('label', <django.forms.fields.CharField object at 0x7f6c0e06f350>), ('name', <django.forms.fields.CharField object at 0x7f6c0e06f390>), ('help_text', <django.forms.fields.CharField object at 0x7f6c0e06f450>), ('initial', <django.forms.fields.SlugField object at 0x7f6c0e06f510>), ('max_length', <django.forms.fields.IntegerField object at 0x7f6c0e06f610>), ('required', <django.forms.fields.BooleanField object at 0x7f6c0e06f6d0>), ('placeholder', <django.forms.fields.CharField object at 0x7f6c0e06f790>)])
media
plugin_data_fields = [('label', ''), ('name', ''), ('help_text', ''), ('initial', ''), ('max_length', '255'), ('required', False), ('placeholder', '')]
Module contents
fobi.contrib.plugins.form_elements.fields.text package
Submodules
fobi.contrib.plugins.form_elements.fields.text.apps module
class fobi.contrib.plugins.form_elements.fields.text.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

Config.

label = 'fobi_contrib_plugins_form_elements_fields_text'
name = 'fobi.contrib.plugins.form_elements.fields.text'
fobi.contrib.plugins.form_elements.fields.text.base module
class fobi.contrib.plugins.form_elements.fields.text.base.TextInputPlugin(user=None)[source]

Bases: fobi.base.FormFieldPlugin

Text field plugin.

form

alias of TextInputForm

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
name = <django.utils.functional.__proxy__ object>
uid = 'text'
fobi.contrib.plugins.form_elements.fields.text.fobi_form_elements module
class fobi.contrib.plugins.form_elements.fields.text.fobi_form_elements.TextInputPlugin(user=None)[source]

Bases: fobi.base.FormFieldPlugin

Text field plugin.

form

alias of TextInputForm

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
name = <django.utils.functional.__proxy__ object>
uid = 'text'
fobi.contrib.plugins.form_elements.fields.text.forms module
class fobi.contrib.plugins.form_elements.fields.text.forms.TextInputForm(data=None, files=None, auto_id=u'id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None)[source]

Bases: django.forms.forms.Form, fobi.base.BaseFormFieldPluginForm

Form for TextInputPlugin.

base_fields = OrderedDict([('label', <django.forms.fields.CharField object at 0x7f6c0e060d50>), ('name', <django.forms.fields.CharField object at 0x7f6c0e060d90>), ('help_text', <django.forms.fields.CharField object at 0x7f6c0e060e50>), ('initial', <django.forms.fields.CharField object at 0x7f6c0e060f10>), ('max_length', <django.forms.fields.IntegerField object at 0x7f6c0e06f050>), ('required', <django.forms.fields.BooleanField object at 0x7f6c0e06f110>), ('placeholder', <django.forms.fields.CharField object at 0x7f6c0e06f1d0>)])
clean()[source]

Validation.

declared_fields = OrderedDict([('label', <django.forms.fields.CharField object at 0x7f6c0e060d50>), ('name', <django.forms.fields.CharField object at 0x7f6c0e060d90>), ('help_text', <django.forms.fields.CharField object at 0x7f6c0e060e50>), ('initial', <django.forms.fields.CharField object at 0x7f6c0e060f10>), ('max_length', <django.forms.fields.IntegerField object at 0x7f6c0e06f050>), ('required', <django.forms.fields.BooleanField object at 0x7f6c0e06f110>), ('placeholder', <django.forms.fields.CharField object at 0x7f6c0e06f1d0>)])
media
plugin_data_fields = [('label', ''), ('name', ''), ('help_text', ''), ('initial', ''), ('max_length', '255'), ('required', False), ('placeholder', '')]
Module contents
fobi.contrib.plugins.form_elements.fields.textarea package
Submodules
fobi.contrib.plugins.form_elements.fields.textarea.apps module
class fobi.contrib.plugins.form_elements.fields.textarea.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

Config.

label = 'fobi_contrib_plugins_form_elements_fields_textarea'
name = 'fobi.contrib.plugins.form_elements.fields.textarea'
fobi.contrib.plugins.form_elements.fields.textarea.base module
class fobi.contrib.plugins.form_elements.fields.textarea.base.TextareaPlugin(user=None)[source]

Bases: fobi.base.FormFieldPlugin

Textarea field plugin.

form

alias of TextareaForm

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
name = <django.utils.functional.__proxy__ object>
uid = 'textarea'
fobi.contrib.plugins.form_elements.fields.textarea.fobi_form_elements module
class fobi.contrib.plugins.form_elements.fields.textarea.fobi_form_elements.TextareaPlugin(user=None)[source]

Bases: fobi.base.FormFieldPlugin

Textarea field plugin.

form

alias of TextareaForm

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
name = <django.utils.functional.__proxy__ object>
uid = 'textarea'
fobi.contrib.plugins.form_elements.fields.textarea.forms module
class fobi.contrib.plugins.form_elements.fields.textarea.forms.TextareaForm(data=None, files=None, auto_id=u'id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None)[source]

Bases: django.forms.forms.Form, fobi.base.BaseFormFieldPluginForm

Form for TextareaPlugin.

base_fields = OrderedDict([('label', <django.forms.fields.CharField object at 0x7f6c0e060850>), ('name', <django.forms.fields.CharField object at 0x7f6c0e060890>), ('help_text', <django.forms.fields.CharField object at 0x7f6c0e060950>), ('initial', <django.forms.fields.CharField object at 0x7f6c0e060a10>), ('required', <django.forms.fields.BooleanField object at 0x7f6c0e060ad0>), ('placeholder', <django.forms.fields.CharField object at 0x7f6c0e060b90>)])
declared_fields = OrderedDict([('label', <django.forms.fields.CharField object at 0x7f6c0e060850>), ('name', <django.forms.fields.CharField object at 0x7f6c0e060890>), ('help_text', <django.forms.fields.CharField object at 0x7f6c0e060950>), ('initial', <django.forms.fields.CharField object at 0x7f6c0e060a10>), ('required', <django.forms.fields.BooleanField object at 0x7f6c0e060ad0>), ('placeholder', <django.forms.fields.CharField object at 0x7f6c0e060b90>)])
media
plugin_data_fields = [('label', ''), ('name', ''), ('help_text', ''), ('initial', ''), ('required', False), ('placeholder', '')]
Module contents
fobi.contrib.plugins.form_elements.fields.time package
Submodules
fobi.contrib.plugins.form_elements.fields.time.apps module
class fobi.contrib.plugins.form_elements.fields.time.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

Config.

label = 'fobi_contrib_plugins_form_elements_fields_time'
name = 'fobi.contrib.plugins.form_elements.fields.time'
fobi.contrib.plugins.form_elements.fields.time.base module
class fobi.contrib.plugins.form_elements.fields.time.base.TimeInputPlugin(user=None)[source]

Bases: fobi.base.FormFieldPlugin

Time field plugin.

form

alias of TimeInputForm

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
name = <django.utils.functional.__proxy__ object>
submit_plugin_form_data(form_entry, request, form, form_element_entries=None, **kwargs)[source]

Submit plugin form data/process.

Parameters:
  • form_entry (fobi.models.FormEntry) – Instance of fobi.models.FormEntry.
  • request (django.http.HttpRequest) –
  • form (django.forms.Form) –
uid = 'time'
fobi.contrib.plugins.form_elements.fields.time.fobi_form_elements module
class fobi.contrib.plugins.form_elements.fields.time.fobi_form_elements.TimeInputPlugin(user=None)[source]

Bases: fobi.base.FormFieldPlugin

Time field plugin.

form

alias of TimeInputForm

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
name = <django.utils.functional.__proxy__ object>
submit_plugin_form_data(form_entry, request, form, form_element_entries=None, **kwargs)[source]

Submit plugin form data/process.

Parameters:
  • form_entry (fobi.models.FormEntry) – Instance of fobi.models.FormEntry.
  • request (django.http.HttpRequest) –
  • form (django.forms.Form) –
uid = 'time'
fobi.contrib.plugins.form_elements.fields.time.forms module
class fobi.contrib.plugins.form_elements.fields.time.forms.TimeInputForm(data=None, files=None, auto_id=u'id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None)[source]

Bases: django.forms.forms.Form, fobi.base.BaseFormFieldPluginForm

Form for TimeInputPlugin.

base_fields = OrderedDict([('label', <django.forms.fields.CharField object at 0x7f6c0e060390>), ('name', <django.forms.fields.CharField object at 0x7f6c0e0603d0>), ('help_text', <django.forms.fields.CharField object at 0x7f6c0e060490>), ('initial', <django.forms.fields.TimeField object at 0x7f6c0e060550>), ('input_formats', <django.forms.fields.CharField object at 0x7f6c0e060610>), ('required', <django.forms.fields.BooleanField object at 0x7f6c0e0606d0>)])
clean_initial()[source]

Clean the initial value.

declared_fields = OrderedDict([('label', <django.forms.fields.CharField object at 0x7f6c0e060390>), ('name', <django.forms.fields.CharField object at 0x7f6c0e0603d0>), ('help_text', <django.forms.fields.CharField object at 0x7f6c0e060490>), ('initial', <django.forms.fields.TimeField object at 0x7f6c0e060550>), ('input_formats', <django.forms.fields.CharField object at 0x7f6c0e060610>), ('required', <django.forms.fields.BooleanField object at 0x7f6c0e0606d0>)])
media
plugin_data_fields = [('label', ''), ('name', ''), ('help_text', ''), ('initial', ''), ('input_formats', ''), ('required', False)]
Module contents
fobi.contrib.plugins.form_elements.fields.url package
Submodules
fobi.contrib.plugins.form_elements.fields.url.apps module
class fobi.contrib.plugins.form_elements.fields.url.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

Config.

label = 'fobi_contrib_plugins_form_elements_fields_url'
name = 'fobi.contrib.plugins.form_elements.fields.url'
fobi.contrib.plugins.form_elements.fields.url.base module
class fobi.contrib.plugins.form_elements.fields.url.base.URLInputPlugin(user=None)[source]

Bases: fobi.base.FormFieldPlugin

URL input plugin.

form

alias of URLInputForm

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
name = <django.utils.functional.__proxy__ object>
uid = 'url'
fobi.contrib.plugins.form_elements.fields.url.fobi_form_elements module
class fobi.contrib.plugins.form_elements.fields.url.fobi_form_elements.URLInputPlugin(user=None)[source]

Bases: fobi.base.FormFieldPlugin

URL input plugin.

form

alias of URLInputForm

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
name = <django.utils.functional.__proxy__ object>
uid = 'url'
fobi.contrib.plugins.form_elements.fields.url.forms module
class fobi.contrib.plugins.form_elements.fields.url.forms.URLInputForm(data=None, files=None, auto_id=u'id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None)[source]

Bases: django.forms.forms.Form, fobi.base.BaseFormFieldPluginForm

Form for URLPlugin.

base_fields = OrderedDict([('label', <django.forms.fields.CharField object at 0x7f6c0e051d90>), ('name', <django.forms.fields.CharField object at 0x7f6c0e051dd0>), ('help_text', <django.forms.fields.CharField object at 0x7f6c0e051e90>), ('initial', <django.forms.fields.URLField object at 0x7f6c0e051f50>), ('max_length', <django.forms.fields.IntegerField object at 0x7f6c0e060090>), ('required', <django.forms.fields.BooleanField object at 0x7f6c0e060150>), ('placeholder', <django.forms.fields.CharField object at 0x7f6c0e060210>)])
clean()[source]
declared_fields = OrderedDict([('label', <django.forms.fields.CharField object at 0x7f6c0e051d90>), ('name', <django.forms.fields.CharField object at 0x7f6c0e051dd0>), ('help_text', <django.forms.fields.CharField object at 0x7f6c0e051e90>), ('initial', <django.forms.fields.URLField object at 0x7f6c0e051f50>), ('max_length', <django.forms.fields.IntegerField object at 0x7f6c0e060090>), ('required', <django.forms.fields.BooleanField object at 0x7f6c0e060150>), ('placeholder', <django.forms.fields.CharField object at 0x7f6c0e060210>)])
media
plugin_data_fields = [('label', ''), ('name', ''), ('help_text', ''), ('initial', ''), ('max_length', '255'), ('required', False), ('placeholder', '')]
Module contents
Module contents
fobi.contrib.plugins.form_elements.security package
Subpackages
fobi.contrib.plugins.form_elements.security.captcha package
Submodules
fobi.contrib.plugins.form_elements.security.captcha.apps module
class fobi.contrib.plugins.form_elements.security.captcha.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

Config.

label = 'fobi_contrib_plugins_form_elements_security_captcha'
name = 'fobi.contrib.plugins.form_elements.security.captcha'
fobi.contrib.plugins.form_elements.security.captcha.base module
class fobi.contrib.plugins.form_elements.security.captcha.base.CaptchaInputPlugin(user=None)[source]

Bases: fobi.base.FormElementPlugin

Captcha field plugin.

form

alias of CaptchaInputForm

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
name = <django.utils.functional.__proxy__ object>
uid = 'captcha'
fobi.contrib.plugins.form_elements.security.captcha.fobi_form_elements module
class fobi.contrib.plugins.form_elements.security.captcha.fobi_form_elements.CaptchaInputPlugin(user=None)[source]

Bases: fobi.base.FormElementPlugin

Captcha field plugin.

form

alias of CaptchaInputForm

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
name = <django.utils.functional.__proxy__ object>
uid = 'captcha'
fobi.contrib.plugins.form_elements.security.captcha.forms module
class fobi.contrib.plugins.form_elements.security.captcha.forms.CaptchaInputForm(data=None, files=None, auto_id=u'id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None)[source]

Bases: django.forms.forms.Form, fobi.base.BaseFormFieldPluginForm

Form for CaptchaInputPlugin.

base_fields = OrderedDict([('label', <django.forms.fields.CharField object at 0x7f6c09257810>), ('name', <django.forms.fields.CharField object at 0x7f6c09257e50>), ('help_text', <django.forms.fields.CharField object at 0x7f6c09257bd0>), ('required', <django.forms.fields.BooleanField object at 0x7f6c0a3aa890>)])
declared_fields = OrderedDict([('label', <django.forms.fields.CharField object at 0x7f6c09257810>), ('name', <django.forms.fields.CharField object at 0x7f6c09257e50>), ('help_text', <django.forms.fields.CharField object at 0x7f6c09257bd0>), ('required', <django.forms.fields.BooleanField object at 0x7f6c0a3aa890>)])
media
plugin_data_fields = [('label', ''), ('name', ''), ('help_text', ''), ('required', True)]
Module contents
fobi.contrib.plugins.form_elements.security.honeypot package
Submodules
fobi.contrib.plugins.form_elements.security.honeypot.apps module
class fobi.contrib.plugins.form_elements.security.honeypot.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

Config.

label = 'fobi_contrib_plugins_form_elements_security_honeypot'
name = 'fobi.contrib.plugins.form_elements.security.honeypot'
fobi.contrib.plugins.form_elements.security.honeypot.base module
class fobi.contrib.plugins.form_elements.security.honeypot.base.HoneypotInputPlugin(user=None)[source]

Bases: fobi.base.FormElementPlugin

Honeypot field plugin.

form

alias of HoneypotInputForm

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
is_hidden = True
name = <django.utils.functional.__proxy__ object>
uid = 'honeypot'
fobi.contrib.plugins.form_elements.security.honeypot.conf module
fobi.contrib.plugins.form_elements.security.honeypot.conf.get_setting(setting, override=None)[source]

Get setting.

Get a setting from fobi.contrib.plugins.form_elements.security.honeypot conf module, falling back to the default.

If override is not None, it will be used instead of the setting.

Parameters:
  • setting – String with setting name
  • override – Value to use when no setting is available. Defaults to None.
Returns:

Setting value.

fobi.contrib.plugins.form_elements.security.honeypot.defaults module
fobi.contrib.plugins.form_elements.security.honeypot.fields module
class fobi.contrib.plugins.form_elements.security.honeypot.fields.HoneypotField(max_length=None, min_length=None, strip=True, *args, **kwargs)[source]

Bases: django.forms.fields.CharField

clean(value)[source]

Check that honeypot value remained the same.

default_error_messages = {'invalid': <django.utils.functional.__proxy__ object at 0x7f6c0e8bd2d0>}
widget

alias of HiddenInput

fobi.contrib.plugins.form_elements.security.honeypot.fobi_form_elements module
class fobi.contrib.plugins.form_elements.security.honeypot.fobi_form_elements.HoneypotInputPlugin(user=None)[source]

Bases: fobi.base.FormElementPlugin

Honeypot field plugin.

form

alias of HoneypotInputForm

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
is_hidden = True
name = <django.utils.functional.__proxy__ object>
uid = 'honeypot'
fobi.contrib.plugins.form_elements.security.honeypot.forms module
class fobi.contrib.plugins.form_elements.security.honeypot.forms.HoneypotInputForm(data=None, files=None, auto_id=u'id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None)[source]

Bases: django.forms.forms.Form, fobi.base.BaseFormFieldPluginForm

Form for HoneypotInputPlugin.

base_fields = OrderedDict([('label', <django.forms.fields.CharField object at 0x7f6c0e8bd510>), ('name', <django.forms.fields.CharField object at 0x7f6c0e0519d0>), ('initial', <django.forms.fields.CharField object at 0x7f6c0e051a90>), ('max_length', <django.forms.fields.IntegerField object at 0x7f6c0e051b50>), ('required', <django.forms.fields.BooleanField object at 0x7f6c0e051c10>)])
declared_fields = OrderedDict([('label', <django.forms.fields.CharField object at 0x7f6c0e8bd510>), ('name', <django.forms.fields.CharField object at 0x7f6c0e0519d0>), ('initial', <django.forms.fields.CharField object at 0x7f6c0e051a90>), ('max_length', <django.forms.fields.IntegerField object at 0x7f6c0e051b50>), ('required', <django.forms.fields.BooleanField object at 0x7f6c0e051c10>)])
media
plugin_data_fields = [('label', ''), ('name', ''), ('initial', ''), ('max_length', '255'), ('required', True)]
fobi.contrib.plugins.form_elements.security.honeypot.settings module
  • HONEYPOT_VALUE (string)
Module contents
fobi.contrib.plugins.form_elements.security.recaptcha package
Submodules
fobi.contrib.plugins.form_elements.security.recaptcha.apps module
class fobi.contrib.plugins.form_elements.security.recaptcha.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

Config.

label = 'fobi_contrib_plugins_form_elements_security_recaptcha'
name = 'fobi.contrib.plugins.form_elements.security.recaptcha'
fobi.contrib.plugins.form_elements.security.recaptcha.base module
class fobi.contrib.plugins.form_elements.security.recaptcha.base.ReCaptchaInputPlugin(user=None)[source]

Bases: fobi.base.FormElementPlugin

ReCaptcha field plugin.

form

alias of ReCaptchaInputForm

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
name = <django.utils.functional.__proxy__ object>
uid = 'recaptcha'
fobi.contrib.plugins.form_elements.security.recaptcha.fobi_form_elements module
class fobi.contrib.plugins.form_elements.security.recaptcha.fobi_form_elements.ReCaptchaInputPlugin(user=None)[source]

Bases: fobi.base.FormElementPlugin

ReCaptcha field plugin.

form

alias of ReCaptchaInputForm

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
name = <django.utils.functional.__proxy__ object>
uid = 'recaptcha'
fobi.contrib.plugins.form_elements.security.recaptcha.forms module
class fobi.contrib.plugins.form_elements.security.recaptcha.forms.ReCaptchaInputForm(data=None, files=None, auto_id=u'id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None)[source]

Bases: django.forms.forms.Form, fobi.base.BaseFormFieldPluginForm

Form for ReCaptchaInputPlugin.

base_fields = OrderedDict([('label', <django.forms.fields.CharField object at 0x7f6c07a4d790>), ('name', <django.forms.fields.CharField object at 0x7f6c07a4dad0>), ('help_text', <django.forms.fields.CharField object at 0x7f6c07a4d810>), ('required', <django.forms.fields.BooleanField object at 0x7f6c07a4da90>)])
declared_fields = OrderedDict([('label', <django.forms.fields.CharField object at 0x7f6c07a4d790>), ('name', <django.forms.fields.CharField object at 0x7f6c07a4dad0>), ('help_text', <django.forms.fields.CharField object at 0x7f6c07a4d810>), ('required', <django.forms.fields.BooleanField object at 0x7f6c07a4da90>)])
media
plugin_data_fields = [('label', ''), ('name', ''), ('help_text', ''), ('required', True)]
Module contents
Module contents
fobi.contrib.plugins.form_elements.test package
Subpackages
fobi.contrib.plugins.form_elements.test.dummy package
Submodules
fobi.contrib.plugins.form_elements.test.dummy.apps module
class fobi.contrib.plugins.form_elements.test.dummy.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

Config.

label = 'fobi_contrib_plugins_form_elements_test_dummy'
name = 'fobi.contrib.plugins.form_elements.test.dummy'
fobi.contrib.plugins.form_elements.test.dummy.base module
class fobi.contrib.plugins.form_elements.test.dummy.base.DummyPlugin(user=None)[source]

Bases: fobi.base.FormElementPlugin

Dummy plugin.

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
name = <django.utils.functional.__proxy__ object>
post_processor()[source]

Post process data.

Always the same.

uid = 'dummy'
fobi.contrib.plugins.form_elements.test.dummy.fobi_form_elements module
class fobi.contrib.plugins.form_elements.test.dummy.fobi_form_elements.DummyPlugin(user=None)[source]

Bases: fobi.base.FormElementPlugin

Dummy plugin.

get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get form field instances.

group = <django.utils.functional.__proxy__ object>
name = <django.utils.functional.__proxy__ object>
post_processor()[source]

Post process data.

Always the same.

uid = 'dummy'
fobi.contrib.plugins.form_elements.test.dummy.widgets module
class fobi.contrib.plugins.form_elements.test.dummy.widgets.BaseDummyPluginWidget(plugin)[source]

Bases: fobi.base.FormElementPluginWidget

Base dummy form element plugin widget.

plugin_uid = 'dummy'
Module contents
Module contents
Module contents
fobi.contrib.plugins.form_handlers package
Subpackages
fobi.contrib.plugins.form_handlers.db_store package
Subpackages
fobi.contrib.plugins.form_handlers.db_store.migrations package
Submodules
fobi.contrib.plugins.form_handlers.db_store.migrations.0001_initial module
class fobi.contrib.plugins.form_handlers.db_store.migrations.0001_initial.Migration(name, app_label)[source]

Bases: django.db.migrations.migration.Migration

dependencies = [(u'fobi', u'0002_auto_20150912_1744'), (u'auth', u'__first__')]
operations = [<CreateModel fields=[(u'id', <django.db.models.fields.AutoField>), (u'form_data_headers', <django.db.models.fields.TextField>), (u'saved_data', <django.db.models.fields.TextField>), (u'created', <django.db.models.fields.DateTimeField>), (u'form_entry', <django.db.models.fields.related.ForeignKey>), (u'user', <django.db.models.fields.related.ForeignKey>)], options={u'abstract': False, u'db_table': u'db_store_savedformdataentry', u'verbose_name': u'Saved form data entry', u'verbose_name_plural': u'Saved form data entries'}, name=u'SavedFormDataEntry'>]
fobi.contrib.plugins.form_handlers.db_store.migrations.0002_savedformwizarddataentry module
class fobi.contrib.plugins.form_handlers.db_store.migrations.0002_savedformwizarddataentry.Migration(name, app_label)[source]

Bases: django.db.migrations.migration.Migration

dependencies = [(u'auth', u'__first__'), (u'fobi', u'0010_formwizardhandler'), (u'fobi_contrib_plugins_form_handlers_db_store', u'0001_initial')]
operations = [<CreateModel fields=[(u'id', <django.db.models.fields.AutoField>), (u'form_data_headers', <django.db.models.fields.TextField>), (u'saved_data', <django.db.models.fields.TextField>), (u'created', <django.db.models.fields.DateTimeField>), (u'form_wizard_entry', <django.db.models.fields.related.ForeignKey>), (u'user', <django.db.models.fields.related.ForeignKey>)], options={u'abstract': False, u'db_table': u'db_store_savedformwizarddataentry', u'verbose_name': u'Saved form wizard data entry', u'verbose_name_plural': u'Saved form wizard data entries'}, name=u'SavedFormWizardDataEntry'>]
Module contents
fobi.contrib.plugins.form_handlers.db_store.urls package
Submodules
fobi.contrib.plugins.form_handlers.db_store.urls.form_handlers module
fobi.contrib.plugins.form_handlers.db_store.urls.form_wizard_handlers module
Module contents
Submodules
fobi.contrib.plugins.form_handlers.db_store.admin module
class fobi.contrib.plugins.form_handlers.db_store.admin.SavedFormDataEntryAdmin(model, admin_site)[source]

Bases: fobi.contrib.plugins.form_handlers.db_store.admin.BaseSavedFormDataEntryAdmin

Saved form data entry admin.

class Meta[source]

Meta class.

app_label = <django.utils.functional.__proxy__ object>
SavedFormDataEntryAdmin.actions = ['export_data']
SavedFormDataEntryAdmin.fieldsets = ((None, {'fields': ('form_entry', 'user')}), (<django.utils.functional.__proxy__ object at 0x7f6c0dfb7910>, {'fields': ('formatted_saved_data', 'created')}), (<django.utils.functional.__proxy__ object at 0x7f6c0dfb7dd0>, {'fields': ('form_data_headers', 'saved_data'), 'classes': ('collapse',)}))
SavedFormDataEntryAdmin.list_display = ('form_entry', 'user', 'formatted_saved_data', 'created')
SavedFormDataEntryAdmin.list_filter = ('form_entry', 'user')
SavedFormDataEntryAdmin.media
SavedFormDataEntryAdmin.only_args = ['form_entry']
SavedFormDataEntryAdmin.readonly_fields = ('created', 'formatted_saved_data')
class fobi.contrib.plugins.form_handlers.db_store.admin.SavedFormWizardDataEntryAdmin(model, admin_site)[source]

Bases: fobi.contrib.plugins.form_handlers.db_store.admin.BaseSavedFormDataEntryAdmin

Saved form wizard data entry admin.

class Meta[source]

Meta class.

app_label = <django.utils.functional.__proxy__ object>
SavedFormWizardDataEntryAdmin.actions = ['export_data']
SavedFormWizardDataEntryAdmin.fieldsets = ((None, {'fields': ('form_wizard_entry', 'user')}), (<django.utils.functional.__proxy__ object at 0x7f6c0dd35150>, {'fields': ('formatted_saved_data', 'created')}), (<django.utils.functional.__proxy__ object at 0x7f6c0dd35290>, {'fields': ('form_data_headers', 'saved_data'), 'classes': ('collapse',)}))
SavedFormWizardDataEntryAdmin.list_display = ('form_wizard_entry', 'user', 'formatted_saved_data', 'created')
SavedFormWizardDataEntryAdmin.list_filter = ('form_wizard_entry', 'user')
SavedFormWizardDataEntryAdmin.media
SavedFormWizardDataEntryAdmin.only_args = ['form_wizard_entry']
SavedFormWizardDataEntryAdmin.readonly_fields = ('created', 'formatted_saved_data')
fobi.contrib.plugins.form_handlers.db_store.apps module
class fobi.contrib.plugins.form_handlers.db_store.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

Config.

label = 'fobi_contrib_plugins_form_handlers_db_store'
name = 'fobi.contrib.plugins.form_handlers.db_store'
fobi.contrib.plugins.form_handlers.db_store.base module
class fobi.contrib.plugins.form_handlers.db_store.base.DBStoreHandlerPlugin(user=None)[source]

Bases: fobi.base.FormHandlerPlugin

DB store form handler plugin.

Can be used only once per form.

allow_multiple = False
custom_actions(form_entry, request=None)[source]

Custom actions.

Adding a link to view the saved form entries.

Return iterable:
 
name = <django.utils.functional.__proxy__ object>
run(form_entry, request, form, form_element_entries=None)[source]

Run.

Parameters:
  • form_entry (fobi.models.FormEntry) – Instance of fobi.models.FormEntry.
  • request (django.http.HttpRequest) –
  • form (django.forms.Form) –
  • form_element_entries (iterable) – Iterable of fobi.models.FormElementEntry objects.
save_form_data_entry(form_entry, request, field_name_to_label_map, cleaned_data)[source]

Save form data entry.

Might be used in integration plugins.

uid = 'db_store'
class fobi.contrib.plugins.form_handlers.db_store.base.DBStoreWizardHandlerPlugin(user=None)[source]

Bases: fobi.base.FormWizardHandlerPlugin

DB store form wizard handler plugin.

Can be used only once per form.

allow_multiple = False
custom_actions(form_wizard_entry, request=None)[source]

Custom actions.

Adding a link to view the saved form entries.

Return iterable:
 
name = <django.utils.functional.__proxy__ object>
run(form_wizard_entry, request, form_list, form_wizard, form_element_entries=None)[source]

Run.

Parameters:
uid = 'db_store'
fobi.contrib.plugins.form_handlers.db_store.conf module
fobi.contrib.plugins.form_handlers.db_store.conf.get_setting(setting, override=None)[source]

Get setting.

Get a setting from fobi.contrib.plugins.form_handlers.db_store conf module, falling back to the default.

If override is not None, it will be used instead of the setting.

Parameters:
  • setting – String with setting name
  • override – Value to use when no setting is available. Defaults to None.
Returns:

Setting value.

fobi.contrib.plugins.form_handlers.db_store.defaults module
fobi.contrib.plugins.form_handlers.db_store.fobi_form_handlers module
class fobi.contrib.plugins.form_handlers.db_store.fobi_form_handlers.DBStoreHandlerPlugin(user=None)[source]

Bases: fobi.base.FormHandlerPlugin

DB store form handler plugin.

Can be used only once per form.

allow_multiple = False
custom_actions(form_entry, request=None)[source]

Custom actions.

Adding a link to view the saved form entries.

Return iterable:
 
name = <django.utils.functional.__proxy__ object>
run(form_entry, request, form, form_element_entries=None)[source]

Run.

Parameters:
  • form_entry (fobi.models.FormEntry) – Instance of fobi.models.FormEntry.
  • request (django.http.HttpRequest) –
  • form (django.forms.Form) –
  • form_element_entries (iterable) – Iterable of fobi.models.FormElementEntry objects.
save_form_data_entry(form_entry, request, field_name_to_label_map, cleaned_data)[source]

Save form data entry.

Might be used in integration plugins.

uid = 'db_store'
class fobi.contrib.plugins.form_handlers.db_store.fobi_form_handlers.DBStoreWizardHandlerPlugin(user=None)[source]

Bases: fobi.base.FormWizardHandlerPlugin

DB store form wizard handler plugin.

Can be used only once per form.

allow_multiple = False
custom_actions(form_wizard_entry, request=None)[source]

Custom actions.

Adding a link to view the saved form entries.

Return iterable:
 
name = <django.utils.functional.__proxy__ object>
run(form_wizard_entry, request, form_list, form_wizard, form_element_entries=None)[source]

Run.

Parameters:
uid = 'db_store'
fobi.contrib.plugins.form_handlers.db_store.helpers module
class fobi.contrib.plugins.form_handlers.db_store.helpers.DataExporter(queryset, only_args)[source]

Bases: object

Exporting the data.

export_to_csv()[source]

Export data to CSV.

export_to_xls()[source]

Export data to XLS.

graceful_export()[source]

Export data into XLS/CSV depending on what is available.

fobi.contrib.plugins.form_handlers.db_store.models module
class fobi.contrib.plugins.form_handlers.db_store.models.AbstractSavedFormDataEntry(*args, **kwargs)[source]

Bases: django.db.models.base.Model

Abstract saved form data entry.

class Meta[source]

Bases: object

Meta class.

abstract = False
AbstractSavedFormDataEntry.created

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

AbstractSavedFormDataEntry.form_data_headers

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

AbstractSavedFormDataEntry.formatted_saved_data()[source]

Shows the formatted saved data records.

Return string:
AbstractSavedFormDataEntry.get_next_by_created(*moreargs, **morekwargs)
AbstractSavedFormDataEntry.get_previous_by_created(*moreargs, **morekwargs)
AbstractSavedFormDataEntry.saved_data

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

AbstractSavedFormDataEntry.user

Accessor to the related object on the forward side of a many-to-one or one-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

child.parent is a ForwardManyToOneDescriptor instance.

AbstractSavedFormDataEntry.user_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class fobi.contrib.plugins.form_handlers.db_store.models.SavedFormDataEntry(*args, **kwargs)[source]

Bases: fobi.contrib.plugins.form_handlers.db_store.models.AbstractSavedFormDataEntry

Saved form data.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception SavedFormDataEntry.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

SavedFormDataEntry.form_entry

Accessor to the related object on the forward side of a many-to-one or one-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

child.parent is a ForwardManyToOneDescriptor instance.

SavedFormDataEntry.form_entry_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

SavedFormDataEntry.get_next_by_created(*moreargs, **morekwargs)
SavedFormDataEntry.get_previous_by_created(*moreargs, **morekwargs)
SavedFormDataEntry.id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

SavedFormDataEntry.objects = <django.db.models.manager.Manager object>
SavedFormDataEntry.user

Accessor to the related object on the forward side of a many-to-one or one-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

child.parent is a ForwardManyToOneDescriptor instance.

class fobi.contrib.plugins.form_handlers.db_store.models.SavedFormWizardDataEntry(*args, **kwargs)[source]

Bases: fobi.contrib.plugins.form_handlers.db_store.models.AbstractSavedFormDataEntry

Saved form data.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception SavedFormWizardDataEntry.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

SavedFormWizardDataEntry.form_wizard_entry

Accessor to the related object on the forward side of a many-to-one or one-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

child.parent is a ForwardManyToOneDescriptor instance.

SavedFormWizardDataEntry.form_wizard_entry_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

SavedFormWizardDataEntry.get_next_by_created(*moreargs, **morekwargs)
SavedFormWizardDataEntry.get_previous_by_created(*moreargs, **morekwargs)
SavedFormWizardDataEntry.id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

SavedFormWizardDataEntry.objects = <django.db.models.manager.Manager object>
SavedFormWizardDataEntry.user

Accessor to the related object on the forward side of a many-to-one or one-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

child.parent is a ForwardManyToOneDescriptor instance.

fobi.contrib.plugins.form_handlers.db_store.settings module
  • CSV_DELIMITER (string)
  • CSV_QUOTECHAR (string)
fobi.contrib.plugins.form_handlers.db_store.views module
fobi.contrib.plugins.form_handlers.db_store.views.view_saved_form_data_entries(request, *args, **kwargs)[source]

View saved form data entries.

Parameters:
  • request (django.http.HttpRequest) –
  • form_entry_id (int) – Form ID.
  • theme (fobi.base.BaseTheme) – Subclass of fobi.base.BaseTheme.
  • template_name (string) –
Return django.http.HttpResponse:
 
fobi.contrib.plugins.form_handlers.db_store.views.export_saved_form_data_entries(request, *args, **kwargs)[source]

Export saved form data entries.

Parameters:
  • request (django.http.HttpRequest) –
  • form_entry_id (int) – Form ID.
  • theme (fobi.base.BaseTheme) – Subclass of fobi.base.BaseTheme.
Return django.http.HttpResponse:
 
fobi.contrib.plugins.form_handlers.db_store.views.view_saved_form_wizard_data_entries(request, *args, **kwargs)[source]

View saved form wizard data entries.

Parameters:
  • request (django.http.HttpRequest) –
  • form_wizard_entry_id (int) – Form ID.
  • theme (fobi.base.BaseTheme) – Subclass of fobi.base.BaseTheme.
  • template_name (string) –
Return django.http.HttpResponse:
 
fobi.contrib.plugins.form_handlers.db_store.views.export_saved_form_wizard_data_entries(request, *args, **kwargs)[source]

Export saved form wizard data entries.

Parameters:
  • request (django.http.HttpRequest) –
  • form_wizard_entry_id (int) – Form ID.
  • theme (fobi.base.BaseTheme) – Subclass of fobi.base.BaseTheme.
Return django.http.HttpResponse:
 
fobi.contrib.plugins.form_handlers.db_store.widgets module
class fobi.contrib.plugins.form_handlers.db_store.widgets.BaseDbStorePluginWidget(plugin)[source]

Bases: fobi.base.FormHandlerPluginWidget

Base dummy form element plugin widget.

export_entries_icon_class = 'glyphicon glyphicon-export'
plugin_uid = 'db_store'
view_entries_icon_class = 'glyphicon glyphicon-list'
view_saved_form_data_entries_template_name = 'db_store/view_saved_form_data_entries.html'
Module contents
fobi.contrib.plugins.form_handlers.http_repost package
Submodules
fobi.contrib.plugins.form_handlers.http_repost.apps module
class fobi.contrib.plugins.form_handlers.http_repost.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

Config.

label = 'fobi_contrib_plugins_form_handlers_http_repost'
name = 'fobi.contrib.plugins.form_handlers.http_repost'
fobi.contrib.plugins.form_handlers.http_repost.base module
class fobi.contrib.plugins.form_handlers.http_repost.base.HTTPRepostHandlerPlugin(user=None)[source]

Bases: fobi.base.FormHandlerPlugin

HTTP repost handler plugin.

Makes a HTTP repost to a given endpoint. Should be executed before db_store plugin.

do_http_repost(request, files)[source]

Re-post data via HTTP.

Might be used in integration plugins.

form

alias of HTTPRepostForm

name = <django.utils.functional.__proxy__ object>
plugin_data_repr()[source]

Human readable representation of plugin data.

Return string:
run(form_entry, request, form, form_element_entries=None)[source]

Run.

Parameters:
  • form_entry (fobi.models.FormEntry) – Instance of fobi.models.FormEntry.
  • request (django.http.HttpRequest) –
  • form (django.forms.Form) –
  • form_element_entries (iterable) – Iterable of fobi.models.FormElementEntry objects.
uid = 'http_repost'
class fobi.contrib.plugins.form_handlers.http_repost.base.HTTPRepostWizardHandlerPlugin(user=None)[source]

Bases: fobi.base.FormWizardHandlerPlugin

HTTP repost wizard handler plugin.

Makes a HTTP repost to a given endpoint. Should be executed before db_store plugin.

form

alias of HTTPRepostForm

name = <django.utils.functional.__proxy__ object>
plugin_data_repr()[source]

Human readable representation of plugin data.

Return string:
run(form_wizard_entry, request, form_list, form_wizard, form_element_entries=None)[source]

Run.

Parameters:
uid = 'http_repost'
fobi.contrib.plugins.form_handlers.http_repost.fobi_form_handlers module
class fobi.contrib.plugins.form_handlers.http_repost.fobi_form_handlers.HTTPRepostHandlerPlugin(user=None)[source]

Bases: fobi.base.FormHandlerPlugin

HTTP repost handler plugin.

Makes a HTTP repost to a given endpoint. Should be executed before db_store plugin.

do_http_repost(request, files)[source]

Re-post data via HTTP.

Might be used in integration plugins.

form

alias of HTTPRepostForm

name = <django.utils.functional.__proxy__ object>
plugin_data_repr()[source]

Human readable representation of plugin data.

Return string:
run(form_entry, request, form, form_element_entries=None)[source]

Run.

Parameters:
  • form_entry (fobi.models.FormEntry) – Instance of fobi.models.FormEntry.
  • request (django.http.HttpRequest) –
  • form (django.forms.Form) –
  • form_element_entries (iterable) – Iterable of fobi.models.FormElementEntry objects.
uid = 'http_repost'
class fobi.contrib.plugins.form_handlers.http_repost.fobi_form_handlers.HTTPRepostWizardHandlerPlugin(user=None)[source]

Bases: fobi.base.FormWizardHandlerPlugin

HTTP repost wizard handler plugin.

Makes a HTTP repost to a given endpoint. Should be executed before db_store plugin.

form

alias of HTTPRepostForm

name = <django.utils.functional.__proxy__ object>
plugin_data_repr()[source]

Human readable representation of plugin data.

Return string:
run(form_wizard_entry, request, form_list, form_wizard, form_element_entries=None)[source]

Run.

Parameters:
uid = 'http_repost'
fobi.contrib.plugins.form_handlers.http_repost.forms module
class fobi.contrib.plugins.form_handlers.http_repost.forms.HTTPRepostForm(data=None, files=None, auto_id=u'id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None)[source]

Bases: django.forms.forms.Form, fobi.base.BasePluginForm

Form for HTTPRepostPlugin.

base_fields = OrderedDict([('endpoint_url', <django.forms.fields.URLField object at 0x7f6c0e040c50>)])
declared_fields = OrderedDict([('endpoint_url', <django.forms.fields.URLField object at 0x7f6c0e040c50>)])
media
plugin_data_fields = [('endpoint_url', '')]
Module contents
fobi.contrib.plugins.form_handlers.mail package
Submodules
fobi.contrib.plugins.form_handlers.mail.apps module
class fobi.contrib.plugins.form_handlers.mail.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

Config.

label = 'fobi_contrib_plugins_form_handlers_mail'
name = 'fobi.contrib.plugins.form_handlers.mail'
fobi.contrib.plugins.form_handlers.mail.base module
class fobi.contrib.plugins.form_handlers.mail.base.MailHandlerPlugin(user=None)[source]

Bases: fobi.base.FormHandlerPlugin

Mail handler plugin.

Sends emails to the person specified. Should be executed before db_store and http_repost plugins.

form

alias of MailForm

get_base_url(request)[source]

Get base URL.

Might be used in integration packages.

get_rendered_data(cleaned_data, field_name_to_label_map, base_url)[source]

Get rendered data.

Might be used in integration packages.

name = <django.utils.functional.__proxy__ object>
plugin_data_repr()[source]

Human readable representation of plugin data.

Return string:
run(form_entry, request, form, form_element_entries=None)[source]

Run.

Parameters:
  • form_entry (fobi.models.FormEntry) – Instance of fobi.models.FormEntry.
  • request (django.http.HttpRequest) –
  • form (django.forms.Form) –
  • form_element_entries (iterable) – Iterable of fobi.models.FormElementEntry objects.
send_email(rendered_data, files)[source]

Send email.

Might be used in integration packages.

uid = 'mail'
class fobi.contrib.plugins.form_handlers.mail.base.MailWizardHandlerPlugin(user=None)[source]

Bases: fobi.base.FormWizardHandlerPlugin

Mail wizard handler plugin.

Sends emails to the person specified. Should be executed before db_store and http_repost plugins.

form

alias of MailForm

name = <django.utils.functional.__proxy__ object>
plugin_data_repr()[source]

Human readable representation of plugin data.

Return string:
run(form_wizard_entry, request, form_list, form_wizard, form_element_entries=None)[source]

Run.

Parameters:
uid = 'mail'
fobi.contrib.plugins.form_handlers.mail.conf module
fobi.contrib.plugins.form_handlers.mail.conf.get_setting(setting, override=None)[source]

Get setting.

Get a setting from fobi.contrib.plugins.form_handlers.mail conf module, falling back to the default.

If override is not None, it will be used instead of the setting.

Parameters:
  • setting – String with setting name
  • override – Value to use when no setting is available. Defaults to None.
Returns:

Setting value.

fobi.contrib.plugins.form_handlers.mail.defaults module
fobi.contrib.plugins.form_handlers.mail.fields module
class fobi.contrib.plugins.form_handlers.mail.fields.MultiEmailField(required=True, widget=None, label=None, initial=None, help_text=u'', error_messages=None, show_hidden_initial=False, validators=[], localize=False, disabled=False, label_suffix=None)[source]

Bases: django.forms.fields.Field

MultiEmailField.

code = 'invalid'
message = <django.utils.functional.__proxy__ object>
to_python(value)[source]

Normalize data to a list of strings.

validate(value)[source]

Check if value consists only of valid emails.

widget

alias of MultiEmailWidget

fobi.contrib.plugins.form_handlers.mail.fobi_form_handlers module
class fobi.contrib.plugins.form_handlers.mail.fobi_form_handlers.MailHandlerPlugin(user=None)[source]

Bases: fobi.base.FormHandlerPlugin

Mail handler plugin.

Sends emails to the person specified. Should be executed before db_store and http_repost plugins.

form

alias of MailForm

get_base_url(request)[source]

Get base URL.

Might be used in integration packages.

get_rendered_data(cleaned_data, field_name_to_label_map, base_url)[source]

Get rendered data.

Might be used in integration packages.

name = <django.utils.functional.__proxy__ object>
plugin_data_repr()[source]

Human readable representation of plugin data.

Return string:
run(form_entry, request, form, form_element_entries=None)[source]

Run.

Parameters:
  • form_entry (fobi.models.FormEntry) – Instance of fobi.models.FormEntry.
  • request (django.http.HttpRequest) –
  • form (django.forms.Form) –
  • form_element_entries (iterable) – Iterable of fobi.models.FormElementEntry objects.
send_email(rendered_data, files)[source]

Send email.

Might be used in integration packages.

uid = 'mail'
class fobi.contrib.plugins.form_handlers.mail.fobi_form_handlers.MailWizardHandlerPlugin(user=None)[source]

Bases: fobi.base.FormWizardHandlerPlugin

Mail wizard handler plugin.

Sends emails to the person specified. Should be executed before db_store and http_repost plugins.

form

alias of MailForm

name = <django.utils.functional.__proxy__ object>
plugin_data_repr()[source]

Human readable representation of plugin data.

Return string:
run(form_wizard_entry, request, form_list, form_wizard, form_element_entries=None)[source]

Run.

Parameters:
uid = 'mail'
fobi.contrib.plugins.form_handlers.mail.forms module
class fobi.contrib.plugins.form_handlers.mail.forms.MailForm(data=None, files=None, auto_id=u'id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None)[source]

Bases: django.forms.forms.Form, fobi.base.BasePluginForm

Form for BooleanSelectPlugin.

base_fields = OrderedDict([('from_name', <django.forms.fields.CharField object at 0x7f6c0e040790>), ('from_email', <django.forms.fields.EmailField object at 0x7f6c0e040850>), ('to_name', <django.forms.fields.CharField object at 0x7f6c0e040910>), ('to_email', <fobi.contrib.plugins.form_handlers.mail.fields.MultiEmailField object at 0x7f6c0e0409d0>), ('subject', <django.forms.fields.CharField object at 0x7f6c0e040a90>), ('body', <django.forms.fields.CharField object at 0x7f6c0e040b50>)])
declared_fields = OrderedDict([('from_name', <django.forms.fields.CharField object at 0x7f6c0e040790>), ('from_email', <django.forms.fields.EmailField object at 0x7f6c0e040850>), ('to_name', <django.forms.fields.CharField object at 0x7f6c0e040910>), ('to_email', <fobi.contrib.plugins.form_handlers.mail.fields.MultiEmailField object at 0x7f6c0e0409d0>), ('subject', <django.forms.fields.CharField object at 0x7f6c0e040a90>), ('body', <django.forms.fields.CharField object at 0x7f6c0e040b50>)])
media
plugin_data_fields = [('from_name', ''), ('from_email', ''), ('to_name', ''), ('to_email', ''), ('subject', ''), ('body', '')]
fobi.contrib.plugins.form_handlers.mail.helpers module
fobi.contrib.plugins.form_handlers.mail.helpers.send_mail(subject, message, from_email, recipient_list, fail_silently=False, auth_user=None, auth_password=None, connection=None, html_message=None, attachments=None)[source]

Send email.

Easy wrapper for sending a single message to a recipient list. All members of the recipient list will see the other recipients in the ‘To’ field.

If auth_user is None, the EMAIL_HOST_USER setting is used. If auth_password is None, the EMAIL_HOST_PASSWORD setting is used.

Note: The API for this method is frozen. New code wanting to extend the functionality should use the EmailMessage class directly.

fobi.contrib.plugins.form_handlers.mail.settings module
fobi.contrib.plugins.form_handlers.mail.widgets module
class fobi.contrib.plugins.form_handlers.mail.widgets.MultiEmailWidget(attrs=None)[source]

Bases: django.forms.widgets.Textarea

Multi email widget.

is_hidden = False
media
prep_value(value)[source]

Prepare value before effectively render widget

render(name, value, attrs=None)[source]

Render.

Module contents
Module contents
fobi.contrib.plugins.form_importers package
Subpackages
fobi.contrib.plugins.form_importers.mailchimp_importer package
Submodules
fobi.contrib.plugins.form_importers.mailchimp_importer.apps module
class fobi.contrib.plugins.form_importers.mailchimp_importer.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

Config.

label = 'fobi_contrib_plugins_form_importers_mailchimp_importer'
name = 'fobi.contrib.plugins.form_importers.mailchimp_importer'
fobi.contrib.plugins.form_importers.mailchimp_importer.base module
class fobi.contrib.plugins.form_importers.mailchimp_importer.base.MailChimpImporter(form_entry_cls, form_element_entry_cls, form_properties=None, form_data=None)[source]

Bases: fobi.form_importers.BaseFormImporter

MailChimp data importer.

extract_field_properties(field_data)[source]

Extract field properties.

Handle choices differently as we know what the mailchimp format is.

field_properties_mapping = {'initial': 'default', 'name': 'tag', 'required': 'req', 'choices': 'choices', 'help_text': 'helptext', 'label': 'name'}
field_type_prop_name = 'field_type'
fields_mapping = {'dropdown': 'select', 'text': 'text', 'imageurl': 'url', 'number': 'integer', 'phone': 'text', 'radio': 'radio', 'address': 'text', 'date': 'date', 'zip': 'text', 'url': 'url', 'email': 'email'}
name = <django.utils.functional.__proxy__ object>
position_prop_name = 'order'
templates = ['mailchimp_importer/0.html', 'mailchimp_importer/1.html']
uid = 'mailchimp'
wizard

alias of MailchimpImporterWizardView

fobi.contrib.plugins.form_importers.mailchimp_importer.fobi_form_importers module
class fobi.contrib.plugins.form_importers.mailchimp_importer.fobi_form_importers.MailChimpImporter(form_entry_cls, form_element_entry_cls, form_properties=None, form_data=None)[source]

Bases: fobi.form_importers.BaseFormImporter

MailChimp data importer.

extract_field_properties(field_data)[source]

Extract field properties.

Handle choices differently as we know what the mailchimp format is.

field_properties_mapping = {'initial': 'default', 'name': 'tag', 'required': 'req', 'choices': 'choices', 'help_text': 'helptext', 'label': 'name'}
field_type_prop_name = 'field_type'
fields_mapping = {'dropdown': 'select', 'text': 'text', 'imageurl': 'url', 'number': 'integer', 'phone': 'text', 'radio': 'radio', 'address': 'text', 'date': 'date', 'zip': 'text', 'url': 'url', 'email': 'email'}
name = <django.utils.functional.__proxy__ object>
position_prop_name = 'order'
templates = ['mailchimp_importer/0.html', 'mailchimp_importer/1.html']
uid = 'mailchimp'
wizard

alias of MailchimpImporterWizardView

fobi.contrib.plugins.form_importers.mailchimp_importer.forms module
class fobi.contrib.plugins.form_importers.mailchimp_importer.forms.MailchimpAPIKeyForm(data=None, files=None, auto_id=u'id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None)[source]

Bases: django.forms.forms.Form

MailchimpAPIKeyForm.

First form the the wizard. Here users are supposed to provide the API key of their Mailchimp account.

base_fields = OrderedDict([('api_key', <django.forms.fields.CharField object at 0x7f6c0e7dc6d0>)])
declared_fields = OrderedDict([('api_key', <django.forms.fields.CharField object at 0x7f6c0e7dc6d0>)])
media
class fobi.contrib.plugins.form_importers.mailchimp_importer.forms.MailchimpListIDForm(*args, **kwargs)[source]

Bases: django.forms.forms.Form

MailchimpListIDForm.

Second form of the wizard. Here users are supposed to choose the form they want to import.

base_fields = OrderedDict([('list_id', <django.forms.fields.ChoiceField object at 0x7f6c0e7c6390>)])
declared_fields = OrderedDict([('list_id', <django.forms.fields.ChoiceField object at 0x7f6c0e7c6390>)])
media
fobi.contrib.plugins.form_importers.mailchimp_importer.views module
class fobi.contrib.plugins.form_importers.mailchimp_importer.views.MailchimpImporterWizardView(**kwargs)[source]

Bases: fobi.wizard.views.views.SessionWizardView

MailchimpImporterWizardView.

done(form_list, **kwargs)[source]
form_list = [<class 'fobi.contrib.plugins.form_importers.mailchimp_importer.forms.MailchimpAPIKeyForm'>, <class 'fobi.contrib.plugins.form_importers.mailchimp_importer.forms.MailchimpListIDForm'>]
get_form_kwargs(step)[source]

Get form kwargs.

Module contents
Module contents
Module contents
fobi.contrib.themes package
Subpackages
fobi.contrib.themes.bootstrap3 package
Subpackages
fobi.contrib.themes.bootstrap3.widgets package
Subpackages
fobi.contrib.themes.bootstrap3.widgets.form_elements package
Subpackages
fobi.contrib.themes.bootstrap3.widgets.form_elements.date_bootstrap3_widget package
Submodules
fobi.contrib.themes.bootstrap3.widgets.form_elements.date_bootstrap3_widget.apps module
class fobi.contrib.themes.bootstrap3.widgets.form_elements.date_bootstrap3_widget.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

Config.

label = 'fobi_contrib_themes_bootstrap3_widgets_form_elements_date_bootstrap3_widget'
name = 'fobi.contrib.themes.bootstrap3.widgets.form_elements.date_bootstrap3_widget'
fobi.contrib.themes.bootstrap3.widgets.form_elements.date_bootstrap3_widget.fobi_form_elements module
class fobi.contrib.themes.bootstrap3.widgets.form_elements.date_bootstrap3_widget.fobi_form_elements.DatePluginWidget(plugin)[source]

Bases: fobi.contrib.plugins.form_elements.fields.date.widgets.BaseDatePluginWidget

Date plugin widget for Bootstrap 3.

media_css = ['bootstrap3/css/bootstrap-datetimepicker.min.css']
media_js = ['js/moment-with-locales.js', 'bootstrap3/js/bootstrap-datetimepicker.min.js', 'bootstrap3/js/fobi.plugin.date-bootstrap3-widget.js']
theme_uid = 'bootstrap3'
Module contents
fobi.contrib.themes.bootstrap3.widgets.form_elements.datetime_bootstrap3_widget package
Submodules
fobi.contrib.themes.bootstrap3.widgets.form_elements.datetime_bootstrap3_widget.apps module
class fobi.contrib.themes.bootstrap3.widgets.form_elements.datetime_bootstrap3_widget.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

Config.

label = 'fobi_contrib_themes_bootstrap3_widgets_form_elements_datetime_bootstrap3_widget'
name = 'fobi.contrib.themes.bootstrap3.widgets.form_elements.datetime_bootstrap3_widget'
fobi.contrib.themes.bootstrap3.widgets.form_elements.datetime_bootstrap3_widget.fobi_form_elements module
class fobi.contrib.themes.bootstrap3.widgets.form_elements.datetime_bootstrap3_widget.fobi_form_elements.DateTimePluginWidget(plugin)[source]

Bases: fobi.contrib.plugins.form_elements.fields.datetime.widgets.BaseDateTimePluginWidget

DateTime plugin widget for Bootstrap 3.

media_css = ['bootstrap3/css/bootstrap-datetimepicker.min.css']
media_js = ['js/moment-with-locales.js', 'bootstrap3/js/bootstrap-datetimepicker.min.js', 'bootstrap3/js/fobi.plugin.datetime-bootstrap3-widget.js']
theme_uid = 'bootstrap3'
Module contents
fobi.contrib.themes.bootstrap3.widgets.form_elements.dummy_bootstrap3_widget package
Submodules
fobi.contrib.themes.bootstrap3.widgets.form_elements.dummy_bootstrap3_widget.apps module
class fobi.contrib.themes.bootstrap3.widgets.form_elements.dummy_bootstrap3_widget.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

Config.

label = 'fobi_contrib_themes_bootstrap3_widgets_form_elements_dummy_bootstrap3_widget'
name = 'fobi.contrib.themes.bootstrap3.widgets.form_elements.dummy_bootstrap3_widget'
fobi.contrib.themes.bootstrap3.widgets.form_elements.dummy_bootstrap3_widget.fobi_form_elements module
class fobi.contrib.themes.bootstrap3.widgets.form_elements.dummy_bootstrap3_widget.fobi_form_elements.DummyPluginWidget(plugin)[source]

Bases: fobi.contrib.plugins.form_elements.test.dummy.widgets.BaseDummyPluginWidget

Dummy plugin widget for Boootstrap 3.

media_css = []
media_js = []
theme_uid = 'bootstrap3'
Module contents
fobi.contrib.themes.bootstrap3.widgets.form_elements.slider_bootstrap3_widget package
Submodules
fobi.contrib.themes.bootstrap3.widgets.form_elements.slider_bootstrap3_widget.apps module
class fobi.contrib.themes.bootstrap3.widgets.form_elements.slider_bootstrap3_widget.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

Config.

label = 'fobi_contrib_themes_bootstrap3_widgets_form_elements_slider_bootstrap3_widget'
name = 'fobi.contrib.themes.bootstrap3.widgets.form_elements.slider_bootstrap3_widget'
fobi.contrib.themes.bootstrap3.widgets.form_elements.slider_bootstrap3_widget.fobi_form_elements module
class fobi.contrib.themes.bootstrap3.widgets.form_elements.slider_bootstrap3_widget.fobi_form_elements.SliderPluginWidget(plugin)[source]

Bases: fobi.contrib.plugins.form_elements.fields.slider.widgets.BaseSliderPluginWidget

Slider plugin widget for Bootstrap 3.

media_css = ['bootstrap3/css/bootstrap-slider.min.css', 'bootstrap3/css/fobi.plugin.slider-bootstrap3-widget.css']
media_js = ['bootstrap3/js/bootstrap-slider.min.js', 'bootstrap3/js/fobi.plugin.slider-bootstrap3-widget.js']
theme_uid = 'bootstrap3'
Module contents
Module contents
Module contents
Submodules
fobi.contrib.themes.bootstrap3.apps module
class fobi.contrib.themes.bootstrap3.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

Config.

label = 'fobi_contrib_themes_bootstrap3'
name = 'fobi.contrib.themes.bootstrap3'
fobi.contrib.themes.bootstrap3.fobi_themes module
class fobi.contrib.themes.bootstrap3.fobi_themes.Bootstrap3Theme(user=None)[source]

Bases: fobi.base.BaseTheme

Bootstrap3 theme.

add_form_element_entry_ajax_template = 'bootstrap3/add_form_element_entry_ajax.html'
add_form_element_entry_template = 'bootstrap3/add_form_element_entry.html'
add_form_handler_entry_ajax_template = 'bootstrap3/add_form_handler_entry_ajax.html'
add_form_handler_entry_template = 'bootstrap3/add_form_handler_entry.html'
add_form_wizard_handler_entry_ajax_template = 'bootstrap3/add_form_wizard_handler_entry_ajax.html'
add_form_wizard_handler_entry_template = 'bootstrap3/add_form_wizard_handler_entry.html'
base_template = 'bootstrap3/base.html'
create_form_entry_ajax_template = 'bootstrap3/create_form_entry_ajax.html'
create_form_entry_template = 'bootstrap3/create_form_entry.html'
create_form_wizard_entry_ajax_template = 'bootstrap3/create_form_wizard_entry_ajax.html'
create_form_wizard_entry_template = 'bootstrap3/create_form_wizard_entry.html'
dashboard_template = 'bootstrap3/dashboard.html'
edit_form_element_entry_ajax_template = 'bootstrap3/edit_form_element_entry_ajax.html'
edit_form_element_entry_template = 'bootstrap3/edit_form_element_entry.html'
edit_form_entry_ajax_template = 'bootstrap3/edit_form_entry_ajax.html'
edit_form_entry_template = 'bootstrap3/edit_form_entry.html'
edit_form_handler_entry_ajax_template = 'bootstrap3/edit_form_handler_entry_ajax.html'
edit_form_handler_entry_template = 'bootstrap3/edit_form_handler_entry.html'
edit_form_wizard_entry_ajax_template = 'bootstrap3/edit_form_wizard_entry_ajax.html'
edit_form_wizard_entry_template = 'bootstrap3/edit_form_wizard_entry.html'
edit_form_wizard_handler_entry_ajax_template = 'bootstrap3/edit_form_wizard_handler_entry_ajax.html'
edit_form_wizard_handler_entry_template = 'bootstrap3/edit_form_wizard_handler_entry.html'
embed_form_entry_submitted_ajax_template = 'bootstrap3/embed_form_entry_submitted_ajax.html'
form_ajax = 'bootstrap3/snippets/form_ajax.html'
form_delete_form_entry_option_class = 'glyphicon glyphicon-remove'
form_edit_form_entry_option_class = 'glyphicon glyphicon-edit'
form_element_checkbox_html_class = 'checkbox'
form_element_html_class = 'form-control'
form_entry_submitted_ajax_template = 'bootstrap3/form_entry_submitted_ajax.html'
form_entry_submitted_template = 'bootstrap3/form_entry_submitted.html'
form_importer_ajax_template = 'bootstrap3/form_importer_ajax.html'
form_importer_template = 'bootstrap3/form_importer.html'
form_list_container_class = 'list-inline'
form_non_field_and_hidden_errors_snippet_template = 'bootstrap3/snippets/form_non_field_and_hidden_errors_snippet.html'
form_properties_snippet_template_name = 'bootstrap3/snippets/form_properties_snippet.html'
form_snippet_template_name = 'bootstrap3/snippets/form_snippet.html'
form_view_form_entry_option_class = 'glyphicon glyphicon-list'
form_wizard_ajax = 'bootstrap3/snippets/form_wizard_ajax.html'
form_wizard_properties_snippet_template_name = 'bootstrap3/snippets/form_wizard_properties_snippet.html'
form_wizard_snippet_template_name = 'bootstrap3/snippets/form_wizard_snippet.html'
form_wizard_template = 'bootstrap3/snippets/form_wizard.html'
form_wizards_dashboard_template = 'bootstrap3/form_wizards_dashboard.html'
forms_list_template = 'bootstrap3/forms_list.html'
master_base_template = 'bootstrap3/_base.html'
media_css = ('bootstrap3/css/bootstrap.css', 'bootstrap3/css/bootstrap3_fobi_extras.css', 'css/fobi.core.css')
media_js = ('js/jquery-1.10.2.min.js', 'jquery-ui/js/jquery-ui-1.10.4.custom.min.js', 'bootstrap3/js/bootstrap.min.js', 'js/jquery.slugify.js', 'js/fobi.core.js', 'bootstrap3/js/bootstrap3_fobi_extras.js')
messages_snippet_template_name = 'bootstrap3/snippets/messages_snippet.html'
name = <django.utils.functional.__proxy__ object>
uid = 'bootstrap3'
view_embed_form_entry_ajax_template = 'bootstrap3/view_embed_form_entry_ajax.html'
view_form_entry_ajax_template = 'bootstrap3/view_form_entry_ajax.html'
view_form_entry_template = 'bootstrap3/view_form_entry.html'
view_form_wizard_entry_ajax_template = 'bootstrap3/view_form_wizard_entry_ajax.html'
view_form_wizard_entry_template = 'bootstrap3/view_form_wizard_entry.html'
Module contents
fobi.contrib.themes.djangocms_admin_style_theme package
Subpackages
fobi.contrib.themes.djangocms_admin_style_theme.widgets package
Subpackages
fobi.contrib.themes.djangocms_admin_style_theme.widgets.form_handlers package
Subpackages
fobi.contrib.themes.djangocms_admin_style_theme.widgets.form_handlers.db_store package
Submodules
fobi.contrib.themes.djangocms_admin_style_theme.widgets.form_handlers.db_store.apps module
class fobi.contrib.themes.djangocms_admin_style_theme.widgets.form_handlers.db_store.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

Config.

label = 'fobi_contrib_themes_djangocms_admin_style_theme_widgets_form_handlers_db_store'
name = 'fobi.contrib.themes.djangocms_admin_style_theme.widgets.form_handlers.db_store'
fobi.contrib.themes.djangocms_admin_style_theme.widgets.form_handlers.db_store.fobi_form_elements module
class fobi.contrib.themes.djangocms_admin_style_theme.widgets.form_handlers.db_store.fobi_form_elements.DbStorePluginWidget(plugin)[source]

Bases: fobi.contrib.plugins.form_handlers.db_store.widgets.BaseDbStorePluginWidget

DbStore plugin widget for djangocms_admin_style_theme theme.

export_entries_icon_class = ''
theme_uid = 'djangocms_admin_style_theme'
view_entries_icon_class = ''
Module contents
Module contents
Module contents
Submodules
fobi.contrib.themes.djangocms_admin_style_theme.apps module
class fobi.contrib.themes.djangocms_admin_style_theme.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

Config.

label = 'fobi_contrib_themes_djangocms_admin_style_theme'
name = 'fobi.contrib.themes.djangocms_admin_style_theme'
fobi.contrib.themes.djangocms_admin_style_theme.fobi_themes module
class fobi.contrib.themes.djangocms_admin_style_theme.fobi_themes.DjangoCMSAdminStyleTheme(user=None)[source]

Bases: fobi.base.BaseTheme

A theme that has a native djangocms-admin-style style.

add_form_element_entry_ajax_template = 'djangocms_admin_style_theme/add_form_element_entry_ajax.html'
add_form_element_entry_template = 'djangocms_admin_style_theme/add_form_element_entry.html'
add_form_handler_entry_ajax_template = 'djangocms_admin_style_theme/add_form_handler_entry_ajax.html'
add_form_handler_entry_template = 'djangocms_admin_style_theme/add_form_handler_entry.html'
base_edit_template = 'djangocms_admin_style_theme/base_edit.html'
base_template = 'djangocms_admin_style_theme/base.html'
base_view_template = 'djangocms_admin_style_theme/base_view.html'
create_form_entry_ajax_template = 'djangocms_admin_style_theme/create_form_entry_ajax.html'
create_form_entry_template = 'djangocms_admin_style_theme/create_form_entry.html'
dashboard_template = 'djangocms_admin_style_theme/dashboard.html'
edit_form_element_entry_ajax_template = 'djangocms_admin_style_theme/edit_form_element_entry_ajax.html'
edit_form_element_entry_template = 'djangocms_admin_style_theme/edit_form_element_entry.html'
edit_form_entry_ajax_template = 'djangocms_admin_style_theme/edit_form_entry_ajax.html'
classmethod edit_form_entry_edit_option_html()[source]

For adding the edit link to edit form entry view.

Return str:
classmethod edit_form_entry_help_text_extra()[source]

For adding the edit link to edit form entry view.

Return str:
edit_form_entry_template = 'djangocms_admin_style_theme/edit_form_entry.html'
edit_form_handler_entry_ajax_template = 'djangocms_admin_style_theme/edit_form_handler_entry_ajax.html'
edit_form_handler_entry_template = 'djangocms_admin_style_theme/edit_form_handler_entry.html'
form_ajax = 'djangocms_admin_style_theme/snippets/form_ajax.html'
form_delete_form_entry_option_class = 'deletelink'
form_edit_ajax = 'djangocms_admin_style_theme/snippets/form_edit_ajax.html'
form_edit_form_entry_option_class = 'edit'
form_edit_snippet_template_name = 'djangocms_admin_style_theme/snippets/form_edit_snippet.html'
form_element_checkbox_html_class = 'checkbox'
form_element_html_class = 'vTextField'
form_entry_submitted_ajax_template = 'djangocms_admin_style_theme/form_entry_submitted_ajax.html'
form_entry_submitted_template = 'djangocms_admin_style_theme/form_entry_submitted.html'
form_list_container_class = 'list-inline'
form_properties_snippet_template_name = 'djangocms_admin_style_theme/snippets/form_properties_snippet.html'
form_radio_element_html_class = 'radiolist'
form_snippet_template_name = 'djangocms_admin_style_theme/snippets/form_snippet.html'
form_view_form_entry_option_class = 'viewlink'
form_view_snippet_template_name = 'djangocms_admin_style_theme/snippets/form_view_snippet.html'
forms_list_template = 'djangocms_admin_style_theme/forms_list.html'
import_form_entry_ajax_template = 'djangocms_admin_style_theme/import_form_entry_ajax.html'
import_form_entry_template = 'djangocms_admin_style_theme/import_form_entry.html'
master_base_template = 'djangocms_admin_style_theme/_base.html'
media_css = ('djangocms_admin_style_theme/css/fobi.djangocms_admin_style_theme.css', 'jquery-ui/css/smoothness/jquery-ui-1.10.3.custom.min.css')
media_js = ('js/jquery-1.10.2.min.js', 'jquery-ui/js/jquery-ui-1.10.4.custom.min.js', 'js/jquery.slugify.js', 'js/fobi.core.js')
messages_snippet_template_name = 'djangocms_admin_style_theme/snippets/messages_snippet.html'
name = <django.utils.functional.__proxy__ object>
uid = 'djangocms_admin_style_theme'
view_form_entry_ajax_template = 'djangocms_admin_style_theme/view_form_entry_ajax.html'
view_form_entry_template = 'djangocms_admin_style_theme/view_form_entry.html'
Module contents
fobi.contrib.themes.foundation5 package
Subpackages
fobi.contrib.themes.foundation5.widgets package
Subpackages
fobi.contrib.themes.foundation5.widgets.form_elements package
Subpackages
fobi.contrib.themes.foundation5.widgets.form_elements.date_foundation5_widget package
Submodules
fobi.contrib.themes.foundation5.widgets.form_elements.date_foundation5_widget.apps module
class fobi.contrib.themes.foundation5.widgets.form_elements.date_foundation5_widget.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

Config.

label = 'fobi_contrib_themes_foundation5_widgets_form_elements_date_foundation5_widget'
name = 'fobi.contrib.themes.foundation5.widgets.form_elements.date_foundation5_widget'
fobi.contrib.themes.foundation5.widgets.form_elements.date_foundation5_widget.fobi_form_elements module
class fobi.contrib.themes.foundation5.widgets.form_elements.date_foundation5_widget.fobi_form_elements.DatePluginWidget(plugin)[source]

Bases: fobi.contrib.plugins.form_elements.fields.date.widgets.BaseDatePluginWidget

Date plugin widget for Foundation 5.

media_css = ['foundation5/css/foundation-datepicker.css']
media_js = ['js/moment-with-locales.js', 'foundation5/js/foundation-datepicker.js', 'foundation5/js/fobi.plugin.date-foundation5-widget.js']
theme_uid = 'foundation5'
Module contents
fobi.contrib.themes.foundation5.widgets.form_elements.datetime_foundation5_widget package
Submodules
fobi.contrib.themes.foundation5.widgets.form_elements.datetime_foundation5_widget.apps module
class fobi.contrib.themes.foundation5.widgets.form_elements.datetime_foundation5_widget.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

Config.

label = 'fobi_contrib_themes_foundation5_widgets_form_elements_datetime_foundation5_widget'
name = 'fobi.contrib.themes.foundation5.widgets.form_elements.datetime_foundation5_widget'
fobi.contrib.themes.foundation5.widgets.form_elements.datetime_foundation5_widget.fobi_form_elements module
class fobi.contrib.themes.foundation5.widgets.form_elements.datetime_foundation5_widget.fobi_form_elements.DateTimePluginWidget(plugin)[source]

Bases: fobi.contrib.plugins.form_elements.fields.datetime.widgets.BaseDateTimePluginWidget

DateTime plugin widget for Foundation 5.

media_css = ['foundation5/css/foundation-datetimepicker.css']
media_js = ['js/moment-with-locales.js', 'foundation5/js/foundation-datetimepicker.js', 'foundation5/js/fobi.plugin.datetime-foundation5-widget.js']
theme_uid = 'foundation5'
Module contents
fobi.contrib.themes.foundation5.widgets.form_elements.dummy_foundation5_widget package
Submodules
fobi.contrib.themes.foundation5.widgets.form_elements.dummy_foundation5_widget.apps module
class fobi.contrib.themes.foundation5.widgets.form_elements.dummy_foundation5_widget.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

Config.

label = 'fobi_contrib_themes_foundation5_widgets_form_elements_dummy_foundation5_widget'
name = 'fobi.contrib.themes.foundation5.widgets.form_elements.dummy_foundation5_widget'
fobi.contrib.themes.foundation5.widgets.form_elements.dummy_foundation5_widget.fobi_form_elements module
class fobi.contrib.themes.foundation5.widgets.form_elements.dummy_foundation5_widget.fobi_form_elements.DummyPluginWidget(plugin)[source]

Bases: fobi.contrib.plugins.form_elements.test.dummy.widgets.BaseDummyPluginWidget

Dummy plugin widget for Foundation 5.

media_css = []
media_js = []
theme_uid = 'foundation5'
Module contents
Module contents
fobi.contrib.themes.foundation5.widgets.form_handlers package
Subpackages
fobi.contrib.themes.foundation5.widgets.form_handlers.db_store_foundation5_widget package
Submodules
fobi.contrib.themes.foundation5.widgets.form_handlers.db_store_foundation5_widget.apps module
class fobi.contrib.themes.foundation5.widgets.form_handlers.db_store_foundation5_widget.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

Config.

label = 'fobi_contrib_themes_foundation5_widgets_form_handlers_db_store_foundation5_widget'
name = 'fobi.contrib.themes.foundation5.widgets.form_handlers.db_store_foundation5_widget'
fobi.contrib.themes.foundation5.widgets.form_handlers.db_store_foundation5_widget.fobi_form_elements module
class fobi.contrib.themes.foundation5.widgets.form_handlers.db_store_foundation5_widget.fobi_form_elements.DbStorePluginWidget(plugin)[source]

Bases: fobi.contrib.plugins.form_handlers.db_store.widgets.BaseDbStorePluginWidget

DbStore plugin widget for Foundation 5.

export_entries_icon_class = 'fi-page-export'
theme_uid = 'foundation5'
view_entries_icon_class = 'fi-list'
view_saved_form_data_entries_template_name = 'db_store_foundation5_widget/view_saved_form_data_entries.html'
Module contents
Module contents
Module contents
Submodules
fobi.contrib.themes.foundation5.apps module
class fobi.contrib.themes.foundation5.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

Config.

label = 'fobi_contrib_themes_foundation5'
name = 'fobi.contrib.themes.foundation5'
fobi.contrib.themes.foundation5.fobi_themes module
class fobi.contrib.themes.foundation5.fobi_themes.Foundation5Theme(user=None)[source]

Bases: fobi.base.BaseTheme

Foundation5 theme.

Based on the “Workspace” example of the Foundation 5. Click here for more.

add_form_element_entry_ajax_template = 'foundation5/add_form_element_entry_ajax.html'
add_form_element_entry_template = 'foundation5/add_form_element_entry.html'
add_form_handler_entry_ajax_template = 'foundation5/add_form_handler_entry_ajax.html'
add_form_handler_entry_template = 'foundation5/add_form_handler_entry.html'
base_template = 'foundation5/base.html'
create_form_entry_ajax_template = 'foundation5/create_form_entry_ajax.html'
create_form_entry_template = 'foundation5/create_form_entry.html'
dashboard_template = 'foundation5/dashboard.html'
edit_form_element_entry_ajax_template = 'foundation5/edit_form_element_entry_ajax.html'
edit_form_element_entry_template = 'foundation5/edit_form_element_entry.html'
edit_form_entry_ajax_template = 'foundation5/edit_form_entry_ajax.html'
edit_form_entry_template = 'foundation5/edit_form_entry.html'
edit_form_handler_entry_ajax_template = 'foundation5/edit_form_handler_entry_ajax.html'
edit_form_handler_entry_template = 'foundation5/edit_form_handler_entry.html'
form_ajax = 'foundation5/snippets/form_ajax.html'
form_delete_form_entry_option_class = 'fi-page-delete'
form_edit_form_entry_option_class = 'fi-page-edit'
form_element_checkbox_html_class = 'checkbox'
form_element_html_class = 'form-control'
form_entry_submitted_ajax_template = 'foundation5/form_entry_submitted_ajax.html'
form_entry_submitted_template = 'foundation5/form_entry_submitted.html'
form_list_container_class = 'inline-list'
form_non_field_and_hidden_errors_snippet_template = 'foundation5/snippets/form_non_field_and_hidden_errors_snippet.html'
form_properties_snippet_template_name = 'foundation5/snippets/form_properties_snippet.html'
form_snippet_template_name = 'foundation5/snippets/form_snippet.html'
form_view_form_entry_option_class = 'fi-list'
forms_list_template = 'foundation5/forms_list.html'
import_form_entry_ajax_template = 'foundation5/import_form_entry_ajax.html'
import_form_entry_template = 'foundation5/import_form_entry.html'
master_base_template = 'foundation5/_base.html'
media_css = ('foundation5/css/foundation.min.css', 'foundation5/css/foundation_fobi_extras.css', 'foundation5/icons/3/icons/foundation-icons.css')
media_js = ('foundation5/js/vendor/modernizr.js', 'foundation5/js/vendor/jquery.js', 'jquery-ui/js/jquery-ui-1.10.4.custom.min.js', 'foundation5/js/foundation.min.js', 'js/fobi.core.js', 'js/jquery.slugify.js', 'foundation5/js/foundation5_fobi_extras.js')
messages_snippet_template_name = 'foundation5/snippets/messages_snippet.html'
name = <django.utils.functional.__proxy__ object>
uid = 'foundation5'
view_form_entry_ajax_template = 'foundation5/view_form_entry_ajax.html'
view_form_entry_template = 'foundation5/view_form_entry.html'
Module contents
fobi.contrib.themes.simple package
Subpackages
fobi.contrib.themes.simple.widgets package
Subpackages
fobi.contrib.themes.simple.widgets.form_handlers package
Subpackages
fobi.contrib.themes.simple.widgets.form_handlers.db_store package
Submodules
fobi.contrib.themes.simple.widgets.form_handlers.db_store.apps module
class fobi.contrib.themes.simple.widgets.form_handlers.db_store.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

Config.

label = 'fobi_contrib_themes_simple_widgets_form_handlers_db_store'
name = 'fobi.contrib.themes.simple.widgets.form_handlers.db_store'
fobi.contrib.themes.simple.widgets.form_handlers.db_store.fobi_form_elements module
class fobi.contrib.themes.simple.widgets.form_handlers.db_store.fobi_form_elements.DbStorePluginWidget(plugin)[source]

Bases: fobi.contrib.plugins.form_handlers.db_store.widgets.BaseDbStorePluginWidget

DbStore plugin widget for Simple theme.

export_entries_icon_class = ''
theme_uid = 'simple'
view_entries_icon_class = ''
Module contents
Module contents
Module contents
Submodules
fobi.contrib.themes.simple.apps module
class fobi.contrib.themes.simple.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

Config.

label = 'fobi_contrib_themes_simple'
name = 'fobi.contrib.themes.simple'
fobi.contrib.themes.simple.fobi_themes module
class fobi.contrib.themes.simple.fobi_themes.SimpleTheme(user=None)[source]

Bases: fobi.base.BaseTheme

Simple theme that has a native Django style.

add_form_element_entry_ajax_template = 'simple/add_form_element_entry_ajax.html'
add_form_element_entry_template = 'simple/add_form_element_entry.html'
add_form_handler_entry_ajax_template = 'simple/add_form_handler_entry_ajax.html'
add_form_handler_entry_template = 'simple/add_form_handler_entry.html'
base_edit_template = 'simple/base_edit.html'
base_template = 'simple/base.html'
base_view_template = 'simple/base_view.html'
create_form_entry_ajax_template = 'simple/create_form_entry_ajax.html'
create_form_entry_template = 'simple/create_form_entry.html'
dashboard_template = 'simple/dashboard.html'
edit_form_element_entry_ajax_template = 'simple/edit_form_element_entry_ajax.html'
edit_form_element_entry_template = 'simple/edit_form_element_entry.html'
edit_form_entry_ajax_template = 'simple/edit_form_entry_ajax.html'
edit_form_entry_template = 'simple/edit_form_entry.html'
edit_form_handler_entry_ajax_template = 'simple/edit_form_handler_entry_ajax.html'
edit_form_handler_entry_template = 'simple/edit_form_handler_entry.html'
form_ajax = 'simple/snippets/form_ajax.html'
form_delete_form_entry_option_class = 'glyphicon glyphicon-remove'
form_edit_ajax = 'simple/snippets/form_edit_ajax.html'
form_edit_form_entry_option_class = 'glyphicon glyphicon-edit'
form_edit_snippet_template_name = 'simple/snippets/form_edit_snippet.html'
form_element_checkbox_html_class = 'checkbox'
form_element_html_class = 'vTextField'
form_entry_submitted_ajax_template = 'simple/form_entry_submitted_ajax.html'
form_entry_submitted_template = 'simple/form_entry_submitted.html'
form_list_container_class = 'list-inline'
form_properties_snippet_template_name = 'simple/snippets/form_properties_snippet.html'
form_radio_element_html_class = 'radiolist'
form_snippet_template_name = 'simple/snippets/form_snippet.html'
form_view_form_entry_option_class = 'glyphicon glyphicon-list'
form_view_snippet_template_name = 'simple/snippets/form_view_snippet.html'
forms_list_template = 'simple/forms_list.html'
import_form_entry_ajax_template = 'simple/import_form_entry_ajax.html'
import_form_entry_template = 'simple/import_form_entry.html'
master_base_template = 'simple/_base.html'
media_css = ('simple/css/fobi.simple.css', 'jquery-ui/css/django-admin-theme/jquery-ui-1.10.4.custom.min.css')
media_js = ('js/jquery-1.10.2.min.js', 'jquery-ui/js/jquery-ui-1.10.4.custom.min.js', 'js/jquery.slugify.js', 'js/fobi.core.js')
messages_snippet_template_name = 'simple/snippets/messages_snippet.html'
name = <django.utils.functional.__proxy__ object>
uid = 'simple'
view_form_entry_ajax_template = 'simple/view_form_entry_ajax.html'
view_form_entry_template = 'simple/view_form_entry.html'
Module contents
Module contents
Module contents
fobi.integration package
Submodules
fobi.integration.helpers module
fobi.integration.helpers.get_template_choices(source, choices, theme_specific_choices_key)[source]

Get the template choices.

It’s possible to provide theme templates per theme or just per project.

Parameters:
  • source (str) – Example value ‘feincms_integration’.
  • or list choices (tuple) –
  • theme_specific_choices_key (str) –
Return list:
fobi.integration.processors module
class fobi.integration.processors.IntegrationProcessor[source]

Bases: object

Generic integration processor.

Parameters:
  • form_sent_get_param (str) –
  • can_redirect (bool) – If set to True, if not authenticated an attempt to redirect user to a login page would be made. Otherwise, a message about authentication would be generated instead (in place of the form). Some content management systems, like Django-CMS, aren’t able to redirect on plugin level. For those systems, the value of can_redirect should be set to False.
  • login_required_template_name (str) – Template to be used for rendering the login required message. This is only important when login_required_redirect is set to False.
can_redirect = True
form_sent_get_param = 'sent'
get_context_data(request, instance, **kwargs)[source]

Get context data.

get_form_template_name(request, instance)[source]

Get form template name.

get_login_required_template_name(request, instance)[source]

Get login required template name.

get_success_page_template_name(request, instance)[source]

Get succes page template name.

integration_check(instance)[source]

Integration check.

Performs a simple check to identify whether the model instance has been implemented according to the expectations.

login_required_template_name = 'fobi/integration/login_required.html'
Module contents
fobi.management package
Subpackages
fobi.management.commands package
Submodules
fobi.management.commands.fobi_find_broken_entries module
class fobi.management.commands.fobi_find_broken_entries.Command(stdout=None, stderr=None, no_color=False)[source]

Bases: django.core.management.base.BaseCommand

Find the broken plugin records in the database:

  • fobi.models.FormElementEntry
  • fobi.models.FormHandlerEntry
handle(*args, **options)[source]

Handle.

fobi.management.commands.fobi_migrate_03_to_04 module
class fobi.management.commands.fobi_migrate_03_to_04.Command(stdout=None, stderr=None, no_color=False)[source]

Bases: django.core.management.base.BaseCommand

Database related changes necessary to upgrade fobi==0.3.* to fobi==0.4.

The full list of changes is listed below:

  • Change the “birthday” occurrences to “date_drop_down”.
handle(*args, **options)[source]

Handle.

fobi.management.commands.fobi_sync_plugins module
class fobi.management.commands.fobi_sync_plugins.Command(stdout=None, stderr=None, no_color=False)[source]

Bases: django.core.management.base.BaseCommand

Adds the missing plugins to database.

This command shall be ran every time a developer adds a new plugin. The following plugins are affected:

  • fobi.models.FormElementPlugin
  • fobi.models.FormHandlerPlugin
handle(*args, **options)[source]

Handle.

fobi.management.commands.fobi_update_plugin_data module
class fobi.management.commands.fobi_update_plugin_data.Command(stdout=None, stderr=None, no_color=False)[source]

Bases: django.core.management.base.BaseCommand

Updates the plugin data for all entries of all users.

Rules for update are specified in the plugin itself.

This command shall be ran if significant changes have been made to the system for which the data shall be updated.

handle(*args, **options)[source]

Handle.

Module contents
Module contents
fobi.migrations package
Submodules
fobi.migrations.0001_initial module
class fobi.migrations.0001_initial.Migration(name, app_label)[source]

Bases: django.db.migrations.migration.Migration

dependencies = [(u'auth', u'__first__'), (u'auth', u'0006_require_contenttypes_0002')]
operations = [<CreateModel fields=[(u'id', <django.db.models.fields.AutoField>), (u'plugin_uid', <django.db.models.fields.CharField>), (u'groups', <django.db.models.fields.related.ManyToManyField>), (u'users', <django.db.models.fields.related.ManyToManyField>)], options={u'abstract': False, u'verbose_name': u'Form element plugin', u'verbose_name_plural': u'Form element plugins'}, name=u'FormElement'>, <CreateModel fields=[(u'id', <django.db.models.fields.AutoField>), (u'plugin_data', <django.db.models.fields.TextField>), (u'plugin_uid', <django.db.models.fields.CharField>), (u'position', <django.db.models.fields.PositiveIntegerField>)], options={u'ordering': [u'position'], u'abstract': False, u'verbose_name': u'Form element entry', u'verbose_name_plural': u'Form element entries'}, name=u'FormElementEntry'>, <CreateModel fields=[(u'id', <django.db.models.fields.AutoField>), (u'name', <django.db.models.fields.CharField>), (u'slug', <autoslug.fields.AutoSlugField>), (u'is_public', <django.db.models.fields.BooleanField>), (u'is_cloneable', <django.db.models.fields.BooleanField>), (u'position', <django.db.models.fields.PositiveIntegerField>), (u'success_page_title', <django.db.models.fields.CharField>), (u'success_page_message', <django.db.models.fields.TextField>), (u'action', <django.db.models.fields.CharField>)], options={u'verbose_name': u'Form entry', u'verbose_name_plural': u'Form entries'}, name=u'FormEntry'>, <CreateModel fields=[(u'id', <django.db.models.fields.AutoField>), (u'name', <django.db.models.fields.CharField>), (u'is_repeatable', <django.db.models.fields.BooleanField>), (u'form_entry', <django.db.models.fields.related.ForeignKey>)], options={u'verbose_name': u'Form fieldset entry', u'verbose_name_plural': u'Form fieldset entries'}, name=u'FormFieldsetEntry'>, <CreateModel fields=[(u'id', <django.db.models.fields.AutoField>), (u'plugin_uid', <django.db.models.fields.CharField>), (u'groups', <django.db.models.fields.related.ManyToManyField>), (u'users', <django.db.models.fields.related.ManyToManyField>)], options={u'abstract': False, u'verbose_name': u'Form handler plugin', u'verbose_name_plural': u'Form handler plugins'}, name=u'FormHandler'>, <CreateModel fields=[(u'id', <django.db.models.fields.AutoField>), (u'plugin_data', <django.db.models.fields.TextField>), (u'plugin_uid', <django.db.models.fields.CharField>), (u'form_entry', <django.db.models.fields.related.ForeignKey>)], options={u'abstract': False, u'verbose_name': u'Form handler entry', u'verbose_name_plural': u'Form handler entries'}, name=u'FormHandlerEntry'>, <CreateModel fields=[(u'id', <django.db.models.fields.AutoField>), (u'name', <django.db.models.fields.CharField>), (u'slug', <autoslug.fields.AutoSlugField>), (u'is_public', <django.db.models.fields.BooleanField>), (u'is_cloneable', <django.db.models.fields.BooleanField>), (u'user', <django.db.models.fields.related.ForeignKey>)], options={u'verbose_name': u'Form wizard entry', u'verbose_name_plural': u'Form wizard entries'}, name=u'FormWizardEntry'>, <AddField field=<django.db.models.fields.related.ForeignKey>, name=u'form_wizard_entry', model_name=u'formentry'>, <AddField field=<django.db.models.fields.related.ForeignKey>, name=u'user', model_name=u'formentry'>, <AddField field=<django.db.models.fields.related.ForeignKey>, name=u'form_entry', model_name=u'formelemententry'>, <AddField field=<django.db.models.fields.related.ForeignKey>, name=u'form_fieldset_entry', model_name=u'formelemententry'>, <AlterUniqueTogether unique_together=set([(u'user', u'slug'), (u'user', u'name')]), name=u'formwizardentry'>, <AlterUniqueTogether unique_together=set([(u'form_entry', u'name')]), name=u'formfieldsetentry'>, <AlterUniqueTogether unique_together=set([(u'user', u'slug'), (u'user', u'name')]), name=u'formentry'>]
fobi.migrations.0002_auto_20150912_1744 module
class fobi.migrations.0002_auto_20150912_1744.Migration(name, app_label)[source]

Bases: django.db.migrations.migration.Migration

dependencies = [(u'fobi', u'0001_initial')]
operations = [<AddField field=<django.db.models.fields.DateTimeField>, name=u'created', model_name=u'formentry'>, <AddField field=<django.db.models.fields.DateTimeField>, name=u'updated', model_name=u'formentry'>]
fobi.migrations.0003_auto_20160517_1005 module
class fobi.migrations.0003_auto_20160517_1005.Migration(name, app_label)[source]

Bases: django.db.migrations.migration.Migration

dependencies = [(u'fobi', u'0002_auto_20150912_1744')]
operations = [<AlterField field=<django.db.models.fields.CharField>, name=u'plugin_uid', model_name=u'formelement'>, <AlterField field=<django.db.models.fields.CharField>, name=u'plugin_uid', model_name=u'formelemententry'>, <AlterField field=<autoslug.fields.AutoSlugField>, name=u'slug', model_name=u'formentry'>, <AlterField field=<django.db.models.fields.CharField>, name=u'plugin_uid', model_name=u'formhandler'>, <AlterField field=<django.db.models.fields.CharField>, name=u'plugin_uid', model_name=u'formhandlerentry'>, <AlterField field=<autoslug.fields.AutoSlugField>, name=u'slug', model_name=u'formwizardentry'>]
fobi.migrations.0004_auto_20160906_1513 module
class fobi.migrations.0004_auto_20160906_1513.Migration(name, app_label)[source]

Bases: django.db.migrations.migration.Migration

dependencies = [(u'fobi', u'0003_auto_20160517_1005')]
operations = [<AlterField field=<django.db.models.fields.CharField>, name=u'plugin_uid', model_name=u'formelement'>, <AlterField field=<django.db.models.fields.CharField>, name=u'plugin_uid', model_name=u'formelemententry'>, <AlterField field=<django.db.models.fields.CharField>, name=u'plugin_uid', model_name=u'formhandler'>, <AlterField field=<django.db.models.fields.CharField>, name=u'plugin_uid', model_name=u'formhandlerentry'>]
fobi.migrations.0005_auto_20160908_1457 module
class fobi.migrations.0005_auto_20160908_1457.Migration(name, app_label)[source]

Bases: django.db.migrations.migration.Migration

dependencies = [(u'fobi', u'0004_auto_20160906_1513')]
operations = [<AlterField field=<django.db.models.fields.CharField>, name=u'plugin_uid', model_name=u'formelement'>, <AlterField field=<django.db.models.fields.CharField>, name=u'plugin_uid', model_name=u'formelemententry'>]
fobi.migrations.0006_auto_20160911_1549 module
class fobi.migrations.0006_auto_20160911_1549.Migration(name, app_label)[source]

Bases: django.db.migrations.migration.Migration

dependencies = [(u'fobi', u'0005_auto_20160908_1457')]
operations = [<AlterField field=<django.db.models.fields.CharField>, name=u'plugin_uid', model_name=u'formhandler'>, <AlterField field=<django.db.models.fields.CharField>, name=u'plugin_uid', model_name=u'formhandlerentry'>]
fobi.migrations.0007_auto_20160926_1652 module
class fobi.migrations.0007_auto_20160926_1652.Migration(name, app_label)[source]

Bases: django.db.migrations.migration.Migration

dependencies = [(u'fobi', u'0006_auto_20160911_1549')]
operations = [<CreateModel fields=[(u'id', <django.db.models.fields.AutoField>), (u'position', <django.db.models.fields.PositiveIntegerField>)], options={u'ordering': [u'position'], u'abstract': False, u'verbose_name': u'Form wizard form entry', u'verbose_name_plural': u'Form wizard form entries'}, name=u'FormWizardFormEntry'>, <RemoveField name=u'form_wizard_entry', model_name=u'formentry'>, <RemoveField name=u'position', model_name=u'formentry'>, <AddField field=<django.db.models.fields.DateTimeField>, name=u'created', model_name=u'formwizardentry'>, <AddField field=<django.db.models.fields.TextField>, name=u'success_page_message', model_name=u'formwizardentry'>, <AddField field=<django.db.models.fields.CharField>, name=u'success_page_title', model_name=u'formwizardentry'>, <AddField field=<django.db.models.fields.DateTimeField>, name=u'updated', model_name=u'formwizardentry'>, <AddField field=<django.db.models.fields.related.ForeignKey>, name=u'form_entry', model_name=u'formwizardformentry'>, <AddField field=<django.db.models.fields.related.ForeignKey>, name=u'form_wizard_entry', model_name=u'formwizardformentry'>, <AlterUniqueTogether unique_together=set([(u'form_wizard_entry', u'form_entry')]), name=u'formwizardformentry'>]
fobi.migrations.0008_formwizardhandlerentry module
class fobi.migrations.0008_formwizardhandlerentry.Migration(name, app_label)[source]

Bases: django.db.migrations.migration.Migration

dependencies = [(u'fobi', u'0007_auto_20160926_1652')]
operations = [<CreateModel fields=[(u'id', <django.db.models.fields.AutoField>), (u'plugin_data', <django.db.models.fields.TextField>), (u'plugin_uid', <django.db.models.fields.CharField>), (u'form_wizard_entry', <django.db.models.fields.related.ForeignKey>)], options={u'abstract': False, u'verbose_name': u'Form wizard handler entry', u'verbose_name_plural': u'Form wizard handler entries'}, name=u'FormWizardHandlerEntry'>]
fobi.migrations.0009_formwizardentry_wizard_type module
class fobi.migrations.0009_formwizardentry_wizard_type.Migration(name, app_label)[source]

Bases: django.db.migrations.migration.Migration

dependencies = [(u'fobi', u'0008_formwizardhandlerentry')]
operations = [<AddField field=<django.db.models.fields.CharField>, name=u'wizard_type', model_name=u'formwizardentry'>]
fobi.migrations.0010_formwizardhandler module
class fobi.migrations.0010_formwizardhandler.Migration(name, app_label)[source]

Bases: django.db.migrations.migration.Migration

dependencies = [(u'auth', u'0007_alter_validators_add_error_messages'), (u'auth', u'__first__'), (u'fobi', u'0009_formwizardentry_wizard_type')]
operations = [<CreateModel fields=[(u'id', <django.db.models.fields.AutoField>), (u'plugin_uid', <django.db.models.fields.CharField>), (u'groups', <django.db.models.fields.related.ManyToManyField>), (u'users', <django.db.models.fields.related.ManyToManyField>)], options={u'abstract': False, u'verbose_name': u'Form wizard handler plugin', u'verbose_name_plural': u'Form wizard handler plugins'}, name=u'FormWizardHandler'>]
fobi.migrations.0011_formentry_title module
class fobi.migrations.0011_formentry_title.Migration(name, app_label)[source]

Bases: django.db.migrations.migration.Migration

dependencies = [(u'fobi', u'0010_formwizardhandler')]
operations = [<AddField field=<django.db.models.fields.CharField>, name=u'title', model_name=u'formentry'>]
fobi.migrations.0012_auto_20161109_1550 module
class fobi.migrations.0012_auto_20161109_1550.Migration(name, app_label)[source]

Bases: django.db.migrations.migration.Migration

dependencies = [(u'fobi', u'0011_formentry_title')]
operations = [<AddField field=<django.db.models.fields.CharField>, name=u'title', model_name=u'formwizardentry'>, <AlterField field=<django.db.models.fields.CharField>, name=u'title', model_name=u'formentry'>]
fobi.migrations.0013_formwizardentry_show_all_navigation_buttons module
class fobi.migrations.0013_formwizardentry_show_all_navigation_buttons.Migration(name, app_label)[source]

Bases: django.db.migrations.migration.Migration

dependencies = [(u'fobi', u'0012_auto_20161109_1550')]
operations = [<AddField field=<django.db.models.fields.BooleanField>, name=u'show_all_navigation_buttons', model_name=u'formwizardentry'>]
fobi.migrations.0014_auto_20170516_1413 module
class fobi.migrations.0014_auto_20170516_1413.Migration(name, app_label)[source]

Bases: django.db.migrations.migration.Migration

dependencies = [(u'fobi', u'0013_formwizardentry_show_all_navigation_buttons')]
operations = [<AlterField field=<autoslug.fields.AutoSlugField>, name=u'slug', model_name=u'formentry'>, <AlterField field=<django.db.models.fields.CharField>, name=u'title', model_name=u'formentry'>, <AlterField field=<autoslug.fields.AutoSlugField>, name=u'slug', model_name=u'formwizardentry'>, <AlterField field=<django.db.models.fields.CharField>, name=u'title', model_name=u'formwizardentry'>, <AlterField field=<django.db.models.fields.CharField>, name=u'wizard_type', model_name=u'formwizardentry'>]
Module contents
fobi.south_migrations package
Submodules
fobi.south_migrations.0001_initial module
fobi.south_migrations.0002_auto__add_field_formentry_created__add_field_formentry_updated module
fobi.south_migrations.0003_auto__add_formwizardformentry__add_unique_formwizardformentry_form_wiz module
Module contents
fobi.templatetags package
Submodules
fobi.templatetags.fobi_tags module
fobi.templatetags.fobi_tags.get_fobi_form_handler_plugin_custom_actions(parser, token)[source]

Get the form handler plugin custom actions.

Note, that plugin shall be a instance of fobi.models.FormHandlerEntry.

Syntax:
{% get_fobi_form_handler_plugin_custom_actions

[plugin] [form_entry] as [context_var_name] %}

Example:
{% get_fobi_form_handler_plugin_custom_actions

plugin form_entry as form_handler_plugin_custom_actions %}

fobi.templatetags.fobi_tags.get_fobi_form_wizard_handler_plugin_custom_actions(parser, token)[source]

Get the form wizard handler plugin custom actions.

Note, that plugin shall be a instance of fobi.models.FormWizardHandlerEntry.

Syntax:
{% get_fobi_form_wizard_handler_plugin_custom_actions

[plugin] [form_wizard_entry] as [context_var_name] %}

Example:
{% get_fobi_form_wizard_handler_plugin_custom_actions
plugin form_wizard_entry as

form_wizard_handler_plugin_custom_actions %}

fobi.templatetags.fobi_tags.get_fobi_plugin(parser, token)[source]

Get the plugin.

Note, that entry shall be a instance of fobi.models.FormElementEntry or fobi.models.FormHandlerEntry.

Syntax:

{% get_fobi_plugin entry as [context_var_name] %}

Example:

{% get_fobi_plugin entry as plugin %}

{% get_fobi_plugin entry as plugin %} {{ plugin.render }}

fobi.templatetags.fobi_tags.get_form_field_type(parser, token)[source]

Get form field type.

Syntax:

{% get_form_field_type [field] as [context_var_name] %}

Example:

{% get_form_field_type form.field as form_field_type %}
{% if form_field_type.is_checkbox %}
    ...
{% endif %}
fobi.templatetags.fobi_tags.get_form_hidden_fields_errors(parser, token)[source]

Get form hidden fields errors.

Syntax:{% get_form_hidden_fields_errors [form] as [context_var_name] %}
Example:{% get_form_hidden_fields_errors form as form_hidden_fields_errors %} {{ form_hidden_fields_errors.as_ul }}
fobi.templatetags.fobi_tags.has_edit_form_entry_permissions(parser, token)[source]

Checks the permissions

Syntax:

{% has_edit_form_entry_permissions as [var_name] %}

Example:

{% has_edit_form_entry_permissions %}

or

{% has_edit_form_entry_permissions as has_permissions %}

Render auth link.

fobi.templatetags.fobi_tags.render_fobi_forms_list(context, queryset, *args, **kwargs)[source]

Render the list of fobi forms.

Syntax:{% render_fobi_forms_list [queryset] [show_edit_link] [show_delete_link] [show_export_link] %}
Example:{% render_fobi_forms_list queryset show_edit_link=True show_delete_link=False show_export_link=False %}
fobi.templatetags.future_compat module
fobi.templatetags.future_compat.firstof(parser, token, escape=False)[source]

Outputs the first variable passed that is not False.

Outputs the first variable passed that is not False, without escaping.

Outputs nothing if all the passed variables are False.

Sample usage:

{% firstof var1 var2 var3 %}

This is equivalent to:

{% if var1 %}
    {{ var1|safe }}
{% elif var2 %}
    {{ var2|safe }}
{% elif var3 %}
    {{ var3|safe }}
{% endif %}

but obviously much cleaner!

You can also use a literal string as a fallback value in case all passed variables are False:

{% firstof var1 var2 var3 "fallback value" %}

If you want to escape the output, use a filter tag:

{% filter force_escape %}
    {% firstof var1 var2 var3 "fallback value" %}
{% endfilter %}
Module contents
fobi.tests package
Submodules
fobi.tests.base module
fobi.tests.base.print_info(func)[source]

Prints some useful info.

fobi.tests.base.skip(func)[source]

Simply skips the test.

fobi.tests.base.is_fobi_setup_completed()[source]

Is fobi setup completed?

fobi.tests.base.mark_fobi_setup_as_completed()[source]

Mark fobi setup as completed.

fobi.tests.constants module
fobi.tests.data module
fobi.tests.helpers module
fobi.tests.helpers.create_form_with_entries(user=None, create_entries_if_form_exist=True, data={}, is_public=False, name='Test form', slug='test-form')[source]

Create test form with entries.

Fills the form with pre-defined plugins.

Parameters:
  • user (django.contrib.auth.models.User) –
  • create_entries_if_form_exist (bool) – If set to True, entries are being created even if form already exists (a database record).
  • data (dict) –
  • is_public (bool) –
  • name (str) –
  • slug (str) –
Return fobi.models.FormEntry:
 

Instance of fobi.models.FormEntry with a number of form elements and handlers filled in.

fobi.tests.helpers.db_clean_up()[source]

Clean up the database.

Clean up the database by removing all form element and form handler entries.

fobi.tests.helpers.get_or_create_admin_user()[source]

Create a user for testing the fobi.

TODO: At the moment an admin account is being tested. Automated tests with diverse accounts are to be implemented.

fobi.tests.helpers.get_or_create_admin_user()[source]

Create a user for testing the fobi.

TODO: At the moment an admin account is being tested. Automated tests with diverse accounts are to be implemented.

fobi.tests.helpers.phantom_js_clean_up()[source]

Clean up Phantom JS.

Kills all phantomjs instances, disregard of their origin.

fobi.tests.test_browser_build_dynamic_forms module
class fobi.tests.test_browser_build_dynamic_forms.BaseFobiBrowserBuldDynamicFormsTest(methodName='runTest')[source]

Bases: django.test.testcases.LiveServerTestCase

Browser tests django-fobi bulding forms functionality.

Backed up by selenium. This test is based on the bootstrap3 theme.

LIVE_SERVER_URL = None
cleans_up_after_itself = True
e = AttributeError("'Settings' object has no attribute 'LIVE_SERVER_URL'",)
classmethod setUpClass()[source]

Set up class.

tearDown()[source]

Tear down.

classmethod tearDownClass()[source]

Tear down class.

test_1001_open_dashboard(*args, **kwargs)

Inner.

test_2001_add_form(*args, **kwargs)

Inner.

test_2002_edit_form(*args, **kwargs)

Inner.

test_2003_delete_form(*args, **kwargs)

Inner.

test_2004_submit_form(*args, **kwargs)

Inner.

test_3001_add_form_elements(*args, **kwargs)

Inner.

test_3002_remove_form_elements(*args, **kwargs)

Inner.

test_3003_edit_form_elements(*args, **kwargs)

Inner.

test_4001_add_form_handlers(*args, **kwargs)

Inner.

test_4002_remove_form_handlers(*args, **kwargs)

Inner.

test_4003_edit_form_handlers(*args, **kwargs)

Inner.

fobi.tests.test_core module
class fobi.tests.test_core.FobiCoreTest(methodName='runTest')[source]

Bases: django.test.testcases.TestCase

Tests of django-fobi core functionality.

setUp()[source]

Set up.

test_01_get_registered_form_element_plugins(*args, **kwargs)

Inner.

test_02_get_registered_form_handler_plugins(*args, **kwargs)

Inner.

test_03_get_registered_form_callbacks(*args, **kwargs)

Inner.

test_04_get_registered_themes(*args, **kwargs)

Inner.

test_05_action_url(*args, **kwargs)

Inner.

fobi.tests.test_drf_integration module
class fobi.tests.test_drf_integration.FobiDjangoRestFrameworkIntegrationTests(methodName='runTest')[source]

Bases: rest_framework.test.APITestCase

DRF integration tests.

setUp()[source]

Set up.

classmethod setUpTestData()[source]

Load initial data for the TestCase

tearDown()[source]

Set up.

test_01_options_action_public_form()[source]

Test OPTIONS action call for public form.

test_02_put_action_public_form()[source]

Test PUT action call for public form.

test_03_fail_put_action_public_form()[source]

Test PUT action call fail test for public form.

test_04_fail_options_action_non_public_form()[source]

Test OPTIONS action call fail test for non-public form.

test_05_fail_put_action()[source]

Test PUT action call fail test for non-public form.

test_06_options_action_non_public_form_auth_user()[source]

Test OPTIONS action call for authorised user for non-public form.

test_07_put_action_non_public_form_auth_user()[source]

Test PUT action call for authorised user for non-public form.

test_08_get_action_public_form()[source]

Test OPTIONS action call for public form.

test_09_get_action_non_public_form_auth_user()[source]

Test GET action call for authorised user for non-public form.

test_10_fail_get_action_non_public_form()[source]

Test GET action call fail test for non-public form.

fobi.tests.test_dynamic_forms module
class fobi.tests.test_dynamic_forms.FobiDynamicFormsTest(methodName='runTest')[source]

Bases: django.test.testcases.TestCase

Tests of django-fob dynamic forms functionality.

setUp()[source]

Set up.

test_01_assemble_form_class_and_render_form(*args, **kwargs)

Inner.

fobi.tests.test_form_importers_mailchimp module
class fobi.tests.test_form_importers_mailchimp.FormImpotersMailchimpTest(methodName='runTest')[source]

Bases: django.test.testcases.TestCase

Tests of form importers mailchimp functionality.

setUp()[source]

Set up.

test_01_test_mailchimp_impoter(*args, **kwargs)

Inner.

fobi.tests.test_sortable_dict module
class fobi.tests.test_sortable_dict.FobiDataStructuresTest(methodName='runTest')[source]

Bases: django.test.testcases.TestCase

Tests of django-fobi data_structures module functionality.

setUp()[source]

Set up.

test_01_sortable_dict_move_before_key(*args, **kwargs)

Inner.

test_02_sortable_dict_move_after_key(*args, **kwargs)

Inner.

Module contents
fobi.urls package
Submodules
fobi.urls.edit module
fobi.urls.view module
Module contents
fobi.wizard package
Subpackages
fobi.wizard.views package
Submodules
fobi.wizard.views.dynamic module
class fobi.wizard.views.dynamic.DynamicWizardView(**kwargs)[source]

Bases: django.views.generic.base.TemplateView

The WizardView is used to create multi-page forms.

Handles all the storage and validation stuff. The wizard is based on Django’s generic class based views.

classmethod as_view(*args, **kwargs)[source]

As view.

This method is used within urls.py to create unique wizardview instances for every request. We need to override this method because we add some kwargs which are needed to make the wizardview usable.

compute_form_list(form_list=None, *args, **kwargs)[source]

Compute the forms list.

condition_dict = None
dispatch(request, *args, **kwargs)[source]

Dispatch.

This method gets called by the routing engine. The first argument is request which contains a HttpRequest instance. The request is stored in self.request for later use. The storage instance is stored in self.storage.

After processing the request using the dispatch method, the response gets updated by the storage engine (for example add cookies).

done(form_list, **kwargs)[source]

Done.

This method must be overridden by a subclass to process to form data after processing all steps.

get(request, *args, **kwargs)[source]

GET requests.

This method handles GET requests.

If a GET request reaches this point, the wizard assumes that the user just starts at the first step or wants to restart the process. The data of the wizard will be resetted before rendering the first step

get_all_cleaned_data()[source]

Get all cleaned data.

Returns a merged dictionary of all step cleaned_data dictionaries. If a step contains a FormSet, the key will be prefixed with ‘formset-‘ and contain a list of the formset cleaned_data dictionaries.

get_cleaned_data_for_step(step)[source]

Get clean data for step.

Returns the cleaned data for a given step. Before returning the cleaned data, the stored values are revalidated through the form. If the data doesn’t validate, None will be returned.

get_context_data(form, **kwargs)[source]

Get context data.

Returns the template context for a step. You can overwrite this method to add more data for all or some steps. This method returns a dictionary containing the rendered form step. Available template context variables are:

  • all extra data stored in the storage backend
  • wizard - a dictionary representation of the wizard instance

Example:

class MyWizard(WizardView):
    def get_context_data(self, form, **kwargs):
        context = super(MyWizard, self).get_context_data(form=form,
                                                         **kwargs)
        if self.steps.current == 'my_step_name':
            context.update({'another_var': True})
        return context
get_form(step=None, data=None, files=None)[source]

Get the form.

Constructs the form for a given step. If no step is defined, the current step will be determined automatically.

The form will be initialized using the data argument to prefill the new form. If needed, instance or queryset (for ModelForm or ModelFormSet) will be added too.

get_form_initial(step)[source]

Get form initial

Returns a dictionary which will be passed to the form for step as initial. If no initial data was provided while initializing the form wizard, an empty dictionary will be returned.

get_form_instance(step)[source]

Get form instance.

Returns an object which will be passed to the form for step as instance. If no instance object was provided while initializing the form wizard, None will be returned.

get_form_kwargs(step=None)[source]

Get form kwargs.

Returns the keyword arguments for instantiating the form (or formset) on the given step.

get_form_list()[source]

Get form list.

This method returns a form_list based on the initial form list but checks if there is a condition method/value in the condition_list. If an entry exists in the condition list, it will call/read the value and respect the result. (True means add the form, False means ignore the form)

The form_list is always generated on the fly because condition methods could use data from other (maybe previous forms).

get_form_prefix(step=None, form=None)[source]

Get form prefix.

Returns the prefix which will be used when calling the actual form for the given step. step contains the step-name, form the form which will be called with the returned prefix.

If no step is given, the form_prefix will determine the current step automatically.

get_form_step_data(form)[source]

Get form step data.

Is used to return the raw form data. You may use this method to manipulate the data.

get_form_step_files(form)[source]

Get form step files.

Is used to return the raw form files. You may use this method to manipulate the data.

get_initial_wizard_data(*args, **kwargs)[source]

This should be implemented in your subclass.

You are supposed to return a dict with the dynamic properties, such as form_list or template_name.

classmethod get_initkwargs(form_list=None, initial_dict=None, instance_dict=None, condition_dict=None, *args, **kwargs)[source]

Create a dict with all needed parameters.

For the form wizard instances.
  • form_list - is a list of forms. The list entries can be single form classes or tuples of (step_name, form_class). If you pass a list of forms, the wizardview will convert the class list to (zero_based_counter, form_class). This is needed to access the form for a specific step.
  • initial_dict - contains a dictionary of initial data dictionaries. The key should be equal to the step_name in the form_list (or the str of the zero based counter - if no step_names added in the form_list)
  • instance_dict - contains a dictionary whose values are model instances if the step is based on a ModelForm and querysets if the step is based on a ModelFormSet. The key should be equal to the step_name in the form_list. Same rules as for initial_dict apply.
  • condition_dict - contains a dictionary of boolean values or callables. If the value of for a specific step_name is callable it will be called with the wizardview instance as the only argument. If the return value is true, the step’s form will be used.
get_next_step(step=None)[source]

Get next step.

Returns the next step after the given step. If no more steps are available, None will be returned. If the step argument is None, the current step will be determined automatically.

get_prefix(request, *args, **kwargs)[source]

Get prefix.

get_prev_step(step=None)[source]

Get previous step.

Returns the previous step before the given step. If there are no steps available, None will be returned. If the step argument is None, the current step will be determined automatically.

get_step_index(step=None)[source]

Get step index.

Returns the index for the given step name. If no step is given, the current step will be used to get the index.

initial_dict = None
instance_dict = None
post(*args, **kwargs)[source]

POST requests.

This method handles POST requests.

The wizard will render either the current step (if form validation wasn’t successful), the next step (if the current step was stored successful) or the done view (if no more steps are available)

process_step(form)[source]

Process the step.

This method is used to post-process the form data. By default, it returns the raw form.data dictionary.

process_step_files(form)[source]

Process step files.

This method is used to post-process the form files. By default, it returns the raw form.files dictionary.

render(form=None, **kwargs)[source]

Render.

Returns a HttpResponse containing all needed context data.

render_done(form, **kwargs)[source]

Render done.

This method gets called when all forms passed. The method should also re-validate all steps to prevent manipulation. If any form fails to validate, render_revalidation_failure should get called. If everything is fine call done.

render_goto_step(goto_step, **kwargs)[source]

Render goto step.

This method gets called when the current step has to be changed. goto_step contains the requested step to go to.

render_next_step(form, **kwargs)[source]

Render next step.

This method gets called when the next step/form should be rendered. form contains the last/current form.

render_revalidation_failure(step, form, **kwargs)[source]

Render revalidation failure.

Gets called when a form doesn’t validate when rendering the done view. By default, it changes the current step to failing forms step and renders the form.

storage_name = None
template_name = 'formtools/wizard/wizard_form.html'
class fobi.wizard.views.dynamic.DynamicSessionWizardView(**kwargs)[source]

Bases: fobi.wizard.views.dynamic.DynamicWizardView

A WizardView with pre-configured SessionStorage backend.

storage_name = 'formtools.wizard.storage.session.SessionStorage'
class fobi.wizard.views.dynamic.DynamicCookieWizardView(**kwargs)[source]

Bases: fobi.wizard.views.dynamic.DynamicWizardView

A WizardView with pre-configured CookieStorage backend.

storage_name = 'formtools.wizard.storage.cookie.CookieStorage'
class fobi.wizard.views.dynamic.DynamicNamedUrlWizardView(**kwargs)[source]

Bases: fobi.wizard.views.dynamic.DynamicWizardView

A WizardView with URL named steps support.

done_step_name = None
get(*args, **kwargs)[source]

GET request.

This renders the form or, if needed, does the http redirects.

get_context_data(form, **kwargs)[source]

Get context data.

NamedUrlWizardView provides the url_name of this wizard in the context dict wizard.

classmethod get_initkwargs(*args, **kwargs)[source]

Get init kwargs.

We require a url_name to reverse URLs later. Additionally users can pass a done_step_name to change the URL name of the “done” view.

get_step_url(step)[source]

Get step URL.

post(*args, **kwargs)[source]

POST request.

Do a redirect if user presses the prev. step button. The rest of this is super’d from WizardView.

render_done(form, **kwargs)[source]

Render done.

When rendering the done view, we have to redirect first (if the URL name doesn’t fit).

render_goto_step(goto_step, **kwargs)[source]

Render goto step.

This method gets called when the current step has to be changed. goto_step contains the requested step to go to.

render_next_step(form, **kwargs)[source]

Render next step.

When using the NamedUrlWizardView, we have to redirect to update the browser’s URL to match the shown step.

render_revalidation_failure(failed_step, form, **kwargs)[source]

Render revalidation failure.

When a step fails, we have to redirect the user to the first failing step.

url_name = None
class fobi.wizard.views.dynamic.DynamicNamedUrlSessionWizardView(**kwargs)[source]

Bases: fobi.wizard.views.dynamic.DynamicNamedUrlWizardView

A NamedUrlWizardView with pre-configured SessionStorage backend.

storage_name = 'formtools.wizard.storage.session.SessionStorage'
class fobi.wizard.views.dynamic.DynamicNamedUrlCookieWizardView(**kwargs)[source]

Bases: fobi.wizard.views.dynamic.DynamicNamedUrlWizardView

A NamedUrlFormWizard with pre-configured CookieStorageBackend.

storage_name = 'formtools.wizard.storage.cookie.CookieStorage'
fobi.wizard.views.views module
class fobi.wizard.views.views.WizardView(**kwargs)[source]

Bases: formtools.wizard.views.WizardView, fobi.wizard.views.views.PatchGetMixin

Patched version of the original WizardView.

get(request, *args, **kwargs)[source]

GET requests.

This method handles GET requests.

If a GET request reaches this point, the wizard assumes that the user just starts at the first step or wants to restart the process. The data of the wizard will be resetted before rendering the first step.

class fobi.wizard.views.views.SessionWizardView(**kwargs)[source]

Bases: formtools.wizard.views.SessionWizardView, fobi.wizard.views.views.PatchGetMixin

A WizardView with pre-configured SessionStorage backend.

get(request, *args, **kwargs)[source]

GET requests.

This method handles GET requests.

If a GET request reaches this point, the wizard assumes that the user just starts at the first step or wants to restart the process. The data of the wizard will be resetted before rendering the first step.

class fobi.wizard.views.views.CookieWizardView(**kwargs)[source]

Bases: formtools.wizard.views.CookieWizardView, fobi.wizard.views.views.PatchGetMixin

A WizardView with pre-configured CookieStorage backend.

get(request, *args, **kwargs)[source]

GET requests.

This method handles GET requests.

If a GET request reaches this point, the wizard assumes that the user just starts at the first step or wants to restart the process. The data of the wizard will be resetted before rendering the first step.

Module contents
Module contents

Submodules

fobi.admin module

fobi.admin.base_bulk_change_plugins(PluginForm, named_url, modeladmin, request, queryset)[source]

Bulk change of plugins action additional view.

class fobi.admin.BasePluginModelAdmin(model, admin_site)[source]

Bases: django.contrib.admin.options.ModelAdmin

Base plugin admin.

class Meta[source]

Bases: object

Meta.

app_label = <django.utils.functional.__proxy__ object>
BasePluginModelAdmin.bulk_change_plugins(*args, **kwargs)[source]

Bulk change plugins.

This is where the data is actually processed.

BasePluginModelAdmin.fieldsets = ((None, {'fields': ('plugin_uid', 'users', 'groups')}),)
BasePluginModelAdmin.filter_horizontal = ('users', 'groups')
BasePluginModelAdmin.get_queryset(request)

Internal method used in get_queryset or queryset methods.

BasePluginModelAdmin.has_add_permission(request)[source]

Has add permissions.

We don’t want to allow to add form elements/handlers manually. It should happen using the management command fobi_sync_plugins instead.

BasePluginModelAdmin.list_display = ('plugin_uid_admin', 'users_list', 'groups_list')
BasePluginModelAdmin.media
BasePluginModelAdmin.readonly_fields = ('plugin_uid', 'plugin_uid_admin')
fobi.admin.bulk_change_form_element_plugins(modeladmin, request, queryset)[source]

Bulk change FormElement plugins.

fobi.admin.bulk_change_form_handler_plugins(modeladmin, request, queryset)[source]

Bulk change FormHandler plugins.

fobi.admin.bulk_change_form_wizard_handler_plugins(modeladmin, request, queryset)[source]

Bulk change FormWizardHandler plugins.

class fobi.admin.FormElementAdmin(model, admin_site)[source]

Bases: fobi.admin.BasePluginModelAdmin

FormElement admin.

actions = [<function bulk_change_form_element_plugins at 0x7f6c0dfa7050>]
get_urls()[source]

Get URLs.

media
class fobi.admin.FormElementEntryAdmin(model, admin_site)[source]

Bases: django.contrib.admin.options.ModelAdmin

FormElementEntry admin.

class Meta[source]

Bases: object

Meta.

app_label = <django.utils.functional.__proxy__ object>
FormElementEntryAdmin.fieldsets = ((<django.utils.functional.__proxy__ object at 0x7f6c0dfab3d0>, {'fields': ('plugin_uid', 'plugin_data')}), (<django.utils.functional.__proxy__ object at 0x7f6c0dfab450>, {'fields': ('form_entry', 'form_fieldset_entry', 'position')}))
FormElementEntryAdmin.get_queryset(request)

Internal method used in get_queryset or queryset methods.

FormElementEntryAdmin.list_display = ('plugin_uid', 'plugin_uid_code', 'plugin_data', 'position', 'form_entry')
FormElementEntryAdmin.list_editable = ('position',)
FormElementEntryAdmin.list_filter = ('form_entry', 'plugin_uid')
FormElementEntryAdmin.media
FormElementEntryAdmin.readonly_fields = ('plugin_uid_code',)
class fobi.admin.FormElementEntryInlineAdmin(parent_model, admin_site)[source]

Bases: django.contrib.admin.options.TabularInline

FormElementEntry inline admin.

extra = 0
fields = ('form_entry', 'plugin_uid', 'plugin_data', 'position')
form

alias of FormElementEntryForm

media
model

alias of FormElementEntry

class fobi.admin.FormEntryAdmin(model, admin_site)[source]

Bases: django.contrib.admin.options.ModelAdmin

FormEntry admin.

class Meta[source]

Bases: object

Meta.

app_label = <django.utils.functional.__proxy__ object>
FormEntryAdmin.fieldsets = ((<django.utils.functional.__proxy__ object at 0x7f6c0eaa9c90>, {'fields': ('name', 'is_public', 'is_cloneable')}), (<django.utils.functional.__proxy__ object at 0x7f6c0eaa94d0>, {'fields': ('success_page_title', 'success_page_message', 'action'), 'classes': ('collapse',)}), (<django.utils.functional.__proxy__ object at 0x7f6c0eaa9590>, {'fields': ('user',), 'classes': ('collapse',)}), (<django.utils.functional.__proxy__ object at 0x7f6c0eaa95d0>, {'fields': ('slug',), 'classes': ('collapse',)}))
FormEntryAdmin.inlines = [<class 'fobi.admin.FormElementEntryInlineAdmin'>, <class 'fobi.admin.FormHandlerEntryInlineAdmin'>]
FormEntryAdmin.list_display = ('name', 'slug', 'user', 'is_public', 'created', 'updated', 'is_cloneable')
FormEntryAdmin.list_editable = ('is_public', 'is_cloneable')
FormEntryAdmin.list_filter = ('is_public', 'is_cloneable')
FormEntryAdmin.media
FormEntryAdmin.radio_fields = {'user': 2}
FormEntryAdmin.readonly_fields = ('slug',)
class fobi.admin.FormFieldsetEntryAdmin(model, admin_site)[source]

Bases: django.contrib.admin.options.ModelAdmin

FormEieldsetEntry admin.

class Meta[source]

Bases: object

Meta.

app_label = <django.utils.functional.__proxy__ object>
FormFieldsetEntryAdmin.fieldsets = ((None, {'fields': ('form_entry', 'name', 'is_repeatable')}),)
FormFieldsetEntryAdmin.list_display = ('form_entry', 'name', 'is_repeatable')
FormFieldsetEntryAdmin.list_editable = ('is_repeatable',)
FormFieldsetEntryAdmin.list_filter = ('is_repeatable',)
FormFieldsetEntryAdmin.media
class fobi.admin.FormHandlerAdmin(model, admin_site)[source]

Bases: fobi.admin.BasePluginModelAdmin

FormHandler admin.

actions = [<function bulk_change_form_handler_plugins at 0x7f6c0dfa70c8>]
get_urls()[source]

Get URLs.

media
class fobi.admin.FormHandlerEntryAdmin(model, admin_site)[source]

Bases: django.contrib.admin.options.ModelAdmin

FormHandlerEntry admin.

class Meta[source]

Bases: object

Meta.

app_label = <django.utils.functional.__proxy__ object>
FormHandlerEntryAdmin.fieldsets = ((<django.utils.functional.__proxy__ object at 0x7f6c0dfab610>, {'fields': ('plugin_uid', 'plugin_data')}), (<django.utils.functional.__proxy__ object at 0x7f6c0dfab690>, {'fields': ('form_entry',)}))
FormHandlerEntryAdmin.get_queryset(request)

Internal method used in get_queryset or queryset methods.

FormHandlerEntryAdmin.list_display = ('plugin_uid', 'plugin_uid_code', 'plugin_data', 'form_entry')
FormHandlerEntryAdmin.list_filter = ('form_entry', 'plugin_uid')
FormHandlerEntryAdmin.media
FormHandlerEntryAdmin.readonly_fields = ('plugin_uid_code',)
class fobi.admin.FormHandlerEntryInlineAdmin(parent_model, admin_site)[source]

Bases: django.contrib.admin.options.TabularInline

FormHandlerEntry inline admin.

extra = 0
fields = ('form_entry', 'plugin_uid', 'plugin_data')
form

alias of FormHandlerEntryForm

media
model

alias of FormHandlerEntry

class fobi.admin.FormWizardEntryAdmin(model, admin_site)[source]

Bases: django.contrib.admin.options.ModelAdmin

FormWizardEntry admin.

class Meta[source]

Bases: object

Meta.

app_label = <django.utils.functional.__proxy__ object>
FormWizardEntryAdmin.fieldsets = ((<django.utils.functional.__proxy__ object at 0x7f6c0eaa9950>, {'fields': ('name', 'is_public', 'is_cloneable')}), (<django.utils.functional.__proxy__ object at 0x7f6c0eaa9a10>, {'fields': ('success_page_title', 'success_page_message'), 'classes': ('collapse',)}), (<django.utils.functional.__proxy__ object at 0x7f6c0eaa99d0>, {'fields': ('user',), 'classes': ('collapse',)}), (<django.utils.functional.__proxy__ object at 0x7f6c0df9af90>, {'fields': ('slug',), 'classes': ('collapse',)}))
FormWizardEntryAdmin.inlines = [<class 'fobi.admin.FormWizardFormEntryInlineAdmin'>, <class 'fobi.admin.FormWizardHandlerEntryInlineAdmin'>]
FormWizardEntryAdmin.list_display = ('name', 'slug', 'user', 'is_public', 'created', 'updated', 'is_cloneable')
FormWizardEntryAdmin.list_editable = ('is_public', 'is_cloneable')
FormWizardEntryAdmin.list_filter = ('is_public', 'is_cloneable')
FormWizardEntryAdmin.media
FormWizardEntryAdmin.radio_fields = {'user': 2}
FormWizardEntryAdmin.readonly_fields = ('slug',)
class fobi.admin.FormWizardFormEntryInlineAdmin(parent_model, admin_site)[source]

Bases: django.contrib.admin.options.TabularInline

FormWizardFormEntry inline admin.

extra = 0
fields = ('form_entry', 'position')
media
model

alias of FormWizardFormEntry

class fobi.admin.FormWizardHandlerAdmin(model, admin_site)[source]

Bases: fobi.admin.BasePluginModelAdmin

FormHandler admin.

actions = [<function bulk_change_form_wizard_handler_plugins at 0x7f6c0dfa7140>]
get_urls()[source]

Get URLs.

media
class fobi.admin.FormWizardHandlerEntryInlineAdmin(parent_model, admin_site)[source]

Bases: django.contrib.admin.options.TabularInline

FormWizardHandlerEntry inline admin.

extra = 0
fields = ('plugin_uid', 'plugin_data')
form

alias of FormWizardHandlerEntryForm

media
model

alias of FormWizardHandlerEntry

fobi.app module

fobi.app.app_name(path, reduce_depth_by=1)[source]

Return another path by reducing the depth by one.

Parameters:
  • path (str) – Absolute app path (from project root).
  • reduce_depth_by (int) –
Return str:
fobi.app.app_config(path, config_app_path='apps.Config')[source]

App config.

Parameters:
  • path (str) – Absolute app path (from project root).
  • config_app_path (str) – Relative config path (from app root)
Return str:

fobi.apps module

class fobi.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

Config.

label = 'fobi'
name = 'fobi'

fobi.base module

Base module. All uids are supposed to be pythonic function names (see PEP http://www.python.org/dev/peps/pep-0008/#function-names).

fobi.base.assemble_form_field_widget_class(base_class, plugin)[source]

Assemble form field widget class.

Finish this or remove.

#TODO

class fobi.base.BaseDataStorage[source]

Bases: object

Base storage data.

class fobi.base.BaseFormFieldPluginForm[source]

Bases: fobi.base.BasePluginForm

Base form for form field plugins.

help_text = <django.forms.fields.CharField object>
label = <django.forms.fields.CharField object>
name = <django.forms.fields.CharField object>
plugin_data_fields = [('name', ''), ('label', ''), ('help_text', ''), ('required', False)]
required = <django.forms.fields.BooleanField object>
validate_plugin_data(form_element_entries, request=None)[source]

Validate plugin data.

Parameters:
  • form_element_entries (iterable) – Iterable of fobi.models.FormElementEntry.
  • request (django.http.HttpRequest) –
Return bool:
class fobi.base.BasePlugin(user=None)[source]

Bases: object

Base plugin.

Base form field from which every form field should inherit.

Properties:
  • uid (string): Plugin uid (obligatory). Example value: ‘dummy’,

    ‘wysiwyg’, ‘news’.

  • name (string): Plugin name (obligatory). Example value:

    ‘Dummy plugin’, ‘WYSIWYG’, ‘Latest news’.

  • description (string): Plugin decription (optional). Example

    value: ‘Dummy plugin used just for testing’.

  • help_text (string): Plugin help text (optional). This text would

    be shown in fobi.views.add_form_plugin_entry and fobi.views.edit_form_plugin_entry views.

  • form: Plugin form (optional). A subclass of django.forms.Form.

    Should be given in case plugin is configurable.

  • add_form_template (str) (optional): Add form template (optional).

    If given, overrides the

    fobi.views.add_form_handler_entry default template.

  • edit_form_template (string): Edit form template (optional). If

    given, overrides the fobi.views.edit_form_handler_entry default template.

  • html_classes (list): List of extra HTML classes for the plugin.

  • group (string): Plugin are grouped under the specified group.

    Override in your plugin if necessary.

add_form_template = None
clone_plugin_data(entry)[source]

Clone plugin data.

Used when copying entries. If any objects or files are created by plugin, they should be cloned.

Parameters:fobi.models.AbstractPluginEntry – Instance of fobi.models.AbstractPluginEntry.
Return string:JSON dumped string of the cloned plugin data. The returned value would be inserted as is into the fobi.models.AbstractPluginEntry.plugin_data field.
delete_plugin_data()[source]

Delete plugin data (internal method).

Used in fobi.views.delete_form_entry and fobi.views.delete_form_handler_entry. Fired automatically, when fobi.models.FormEntry object is about to be deleted. Make use of it if your plugin creates database records or files that are not monitored externally but by fobi only.

description = None
edit_form_template = None
form = None
get_cloned_plugin_data(update={})[source]

Get cloned plugin data.

Get the cloned plugin data and returns it in a JSON dumped format.

Parameters:update (dict) –
Return string:JSON dumped string of the cloned plugin data.
Example:
In the get_cloned_plugin_data method of your plugin, do as
follows:
>>> def clone_plugin_data(self, dashboard_entry):
>>>     cloned_image = clone_file(self.data.image, relative_path=True)
>>>     return self.get_cloned_plugin_data(
>>>         update={'image': cloned_image}
>>>     )
get_form()[source]

Get the plugin form class.

Override this method in your subclassed fobi.base.BasePlugin class when you need your plugin setup to vary depending on the placeholder, workspace, user or request given. By default returns the value of the form attribute defined in your plugin.

Return django.forms.Form|django.forms.ModelForm:
 Subclass of django.forms.Form or django.forms.ModelForm.
get_initialised_create_form(data=None, files=None, initial_data=None)[source]

Get initialized create form.

Used fobi.views.add_form_element_entry and fobi.views.add_form_handler_entry view to gets initialised form for object to be created.

get_initialised_create_form_or_404(data=None, files=None)[source]

Get initialized create form or page 404.

Same as get_initialised_create_form but raises django.http.Http404 on errors.

get_initialised_edit_form(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=':', empty_permitted=False, instance=None)[source]

Get initialized edit form.

Used in fobi.views.edit_form_element_entry and fobi.views.edit_form_handler_entry views.

get_initialised_edit_form_or_404(data=None, files=None, auto_id='id_%s', prefix=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=':', empty_permitted=False)[source]

Get initialized edit form or page 404.

Same as get_initialised_edit_form but raises django.http.Http404 on errors.

get_instance()[source]

Get instance.

get_plugin_form_data()[source]

Get plugin form data.

Fed as initial argument to the plugin form when initialising the instance for adding or editing the plugin. Override in your plugin class if you need customisations.

get_updated_plugin_data(update={})[source]

Get updated plugin data.

Returns it in a JSON dumped format.

Parameters:update (dict) –
Return string:JSON dumped string of the cloned plugin data.
get_widget(request=None, as_instance=False)[source]

Get the plugin widget.

Parameters:
  • request (django.http.HttpRequest) –
  • as_instance (bool) –
Return mixed:

Subclass of fobi.base.BasePluginWidget or instance of subclassed fobi.base.BasePluginWidget object.

group = <django.utils.functional.__proxy__ object>
help_text = None
html_class

HTML class.

A massive work on positioning the plugin and having it to be displayed in a given width is done here. We should be getting the plugin widget for the plugin given and based on its’ properties (static!) as well as on plugin position (which we have from model), we can show the plugin with the exact class.

html_classes = []
html_id

HTML id.

load_plugin_data(plugin_data)[source]

Load plugin data.

Load the plugin data saved in fobi.models.FormElementEntry or fobi.models.FormHandlerEntry. Plugin data is saved in JSON string.

Parameters:plugin_data (string) – JSON string with plugin data.
media_css = []
media_js = []
name = None
plugin_data_repr()[source]

Plugin data repr.

Human readable representation of plugin data. A very basic way would be just:

>>> return self.data.__dict__
Return string:
post_processor()[source]

Post-processor (self).

Redefine in your subclassed plugin when necessary.

Post process plugin data here (before rendering). This method is being called after the data has been loaded into the plugin.

Note, that request (django.http.HttpRequest) is available (self.request).

pre_processor()[source]

Pre-processor (callback).

Redefine in your subclassed plugin when necessary.

Pre process plugin data (before rendering). This method is being called before the data has been loaded into the plugin.

Note, that request (django.http.HttpRequest) is available ( self.request).

process(plugin_data=None, fetch_related_data=False)[source]

Process.

Init plugin with data.

process_plugin_data(fetch_related_data=False)[source]

Processes plugin data.

render(request=None)[source]

Renders the plugin HTML.

Parameters:request (django.http.HttpRequest) –
Return string:
storage = None
uid = None
update_plugin_data(entry)[source]

Update plugin data.

Used in fobi.management.commands.fobi_update_plugin_data.

Some plugins would contain data fetched from various sources (models, remote data). Since form entries are by definition loaded extremely much, you are advised to store as much data as possible in plugin_data field of fobi.models.FormElementEntry or fobi.models.FormHandlerEntry. Some externally fetched data becomes invalid after some time and needs updating. For that purpose, in case if your plugin needs that, redefine this method in your plugin. If you need your data to be periodically updated, add a cron-job which would run fobi_update_plugin_data management command (see fobi.management.commands.fobi_update_plugin_data module).

Parameters:or fobi.models.FormHandlerEntry (fobi.models.FormElementEntry) – Instance of fobi.models.FormeHandlerEntry.
Return dict:Should return a dictionary containing data of fields to be updated.
widget = None
class fobi.base.BasePluginForm[source]

Bases: object

Not a form actually; defined for magic only.

Property iterable plugin_data_fields:
 

Fields to get when calling the get_plugin_data method. These field will be JSON serialized. All other fields, even if they are part of the form, won’t be. Make sure all fields are serializable. If some of them aren’t, override the save_plugin_data method and make them serializable there. See fobi.contrib.plugins.form_elements.fields.select.forms as a good example.

Example:
>>> plugin_data_fields = (
>>>    ('name', ''),
>>>    ('active': False)
>>> )
get_plugin_data(request=None, json_format=True)[source]

Get plugin data.

Data that would be saved in the plugin_data field of the fobi.models.FormElementEntry or ``fobi.models.FormHandlerEntry`.` subclassed model.

Parameters:request (django.http.HttpRequest) –
plugin_data_fields = None
save_plugin_data(request=None)[source]

Save plugin data.

Dummy, but necessary.

validate_plugin_data(form_element_entries, request=None)[source]

Validate plugin data.

Parameters:
  • form_element_entries (iterable) – Iterable of fobi.models.FormElementEntry.
  • request (django.http.HttpRequest) –
Return bool:
class fobi.base.BaseRegistry[source]

Bases: object

Base registry.

Registry of plugins. It’s essential, that class registered has the uid property.

If fail_on_missing_plugin is set to True, an appropriate exception (plugin_not_found_exception_cls) is raised in cases if plugin could’t be found in the registry.

Property mixed type:
 
Property bool fail_on_missing_plugin:
 
Property fobi.exceptions.DoesNotExist plugin_not_found_exception_cls:
 
Property str plugin_not_found_error_message:
 
fail_on_missing_plugin = False
get(uid, default=None)[source]

Get the given entry from the registry.

Parameters:
  • uid (string) –
  • default (mixed) –

:return mixed.

items()[source]

Shortcut to self._registry.items().

plugin_not_found_error_message = "Can't find plugin with uid `{0}` in `{1}` registry."
plugin_not_found_exception_cls

alias of DoesNotExist

register(cls, force=False)[source]

Registers the plugin in the registry.

Parameters:
  • cls (mixed) –
  • force (bool) –
registry

Shortcut to self._registry.

type = None
unregister(cls)[source]

Un-register.

class fobi.base.ClassProperty[source]

Bases: property

ClassProperty.

fobi.base.classproperty

alias of ClassProperty

fobi.base.collect_plugin_media(form_element_entries, request=None)[source]

Collect the plugin media for form element entries given.

Parameters:
  • form_element_entries (iterable) – Iterable of fobi.models.FormElementEntry instances.
  • request (django.http.HttpRequest) –
Return dict:

Returns a dict containing the ‘js’ and ‘css’ keys. Correspondent values of those keys are lists containing paths to the CSS and JS media files.

fobi.base.ensure_autodiscover()[source]

Ensure that plugins are auto-discovered.

The form callbacks registry is intentionally left out, since they will be auto-discovered in any case if other modules are discovered.

fobi.base.fire_form_callbacks(form_entry, request, form, stage=None)[source]

Fire form callbacks.

Parameters:
  • form_entry (fobi.models.FormEntry) –
  • request (django.http.HttpRequest) –
  • form (django.forms.Form) –
  • stage (string) –
Return django.forms.Form form:
 
class fobi.base.FormCallback[source]

Bases: fobi.base.BaseFormCallback

Form callback.

callback(form_entry, request, form)[source]

Callback.

Custom callback code should be implemented here.

Parameters:
  • form_entry (fobi.models.FormEntry) – Instance of fobi.models.FormEntry.
  • request (django.http.HttpRequest) –
  • form (django.forms.Form) –
class fobi.base.FormCallbackRegistry[source]

Bases: object

Registry of callbacks.

Holds callbacks for stages listed in the fobi.constants.CALLBACK_STAGES.

get_callbacks(stage=None)[source]

Get callbacks for the stage given.

Parameters:stage (string) –
Return list:
register(cls)[source]

Registers the plugin in the registry.

Parameters:cls (mixed) –
uidfy(cls)[source]

Makes a UID string from the class given.

Parameters:cls (mixed) –
Return string:
class fobi.base.FormElementPlugin(user=None)[source]

Bases: fobi.base.BasePlugin

Base form element plugin.

Property fobi.base.FormElementPluginDataStorage storage:
 
Property bool has_value:
 If set to False, ignored (removed) from the POST when processing the form.
get_custom_field_instances(integrate_with, request=None, form_entry=None, form_element_entries=None, has_value=None, **kwargs)[source]

Get custom field instances.

Parameters:
  • integrate_with (str) –
  • request (django.http.HttpRequest) –
  • form_entry
  • form_element_entries
  • has_value (bool) – If not None, used for filtering out.
Return list:
get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]

Get the instances of form fields, that plugin contains.

Parameters:
Return list:

List of Django form field instances.

Example:
>>> from django.forms.fields import CharField, IntegerField, TextField
>>> [CharField(max_length=100), IntegerField(), TextField()]
get_origin_kwargs_update_func_results(kwargs_update_func, form_element_entry, origin, extra={}, widget_cls=None)[source]

Get origin kwargs update func results.

If kwargs_update_func is given, is callable and returns results without failures, return the result. Otherwise - return None.

get_origin_return_func_results(return_func, form_element_entry, origin)[source]

Get origin return func results.

If return_func is given, is callable and returns results without failures, return the result. Otherwise - return None.

has_value = False
is_hidden = False
storage

alias of FormElementPluginDataStorage

submit_plugin_form_data(form_entry, request, form, form_element_entries=None, **kwargs)[source]

Submit plugin form data.

Called on form submission (when user actually posts the data to assembled form).

Parameters:
  • form_entry (fobi.models.FormEntry) – Instance of fobi.models.FormEntry.
  • request (django.http.HttpRequest) –
  • form (django.forms.Form) –
  • form_element_entries (iterable) –
class fobi.base.FormElementPluginDataStorage[source]

Bases: fobi.base.BaseDataStorage

Storage for FormElementPlugin data.

class fobi.base.FormElementPluginRegistry[source]

Bases: fobi.base.BaseRegistry

Form element plugins registry.

fail_on_missing_plugin = True
plugin_not_found_exception_cls

alias of FormElementPluginDoesNotExist

type = (<class 'fobi.base.FormElementPlugin'>, <class 'fobi.base.FormFieldPlugin'>)
class fobi.base.FormElementPluginWidget(plugin)[source]

Bases: fobi.base.BasePluginWidget

Form element plugin widget.

storage

alias of FormElementPluginWidgetDataStorage

class fobi.base.FormElementPluginWidgetRegistry[source]

Bases: fobi.base.BasePluginWidgetRegistry

Registry of form element plugins.

type

alias of FormElementPluginWidget

class fobi.base.FormFieldPlugin(user=None)[source]

Bases: fobi.base.FormElementPlugin

Form field plugin.

has_value = True
class fobi.base.FormHandlerPlugin(user=None)[source]

Bases: fobi.base.BasePlugin

Form handler plugin.

Property fobi.base.FormHandlerPluginDataStorage storage:
 
Property bool allow_multiple:
 If set to True, plugin can be used multiple times within (per form). Otherwise - just once.
allow_multiple = True
custom_actions(form_entry, request=None)[source]

Custom actions.

Override this method in your form handler if you want to specify custom actions. Note, that expected return value of this method is an iterable with a triple, where the first item is the URL of the action and the second item is the action title and the third item is the icon class of the action.

Example:
>>>  return (
>>>      ('/add-to-favorites/',
>>>       'Add to favourites',
>>>       'glyphicon glyphicon-favourties'),
>>>  )
get_custom_actions(form_entry, request=None)[source]

Internal method to for obtaining the get_custom_actions.

run(form_entry, request, form, form_element_entries=None)[source]

Run.

Custom code should be implemented here.

Parameters:
  • form_entry (fobi.models.FormEntry) – Instance of fobi.models.FormEntry.
  • request (django.http.HttpRequest) –
  • form (django.forms.Form) –
  • form_element_entries (iterable) – Iterable of fobi.models.FormElementEntry objects.
Return mixed:

May be a tuple (bool, mixed) or None

run_integration_handler(integrate_with, form_entry, request, form_element_entries=None, **kwargs)[source]

Run integration handler.

storage

alias of FormHandlerPluginDataStorage

class fobi.base.FormHandlerPluginDataStorage[source]

Bases: fobi.base.BaseDataStorage

Storage for FormHandlerPlugin data.

class fobi.base.FormHandlerPluginRegistry[source]

Bases: fobi.base.BaseRegistry

Form handler plugins registry.

fail_on_missing_plugin = True
plugin_not_found_exception_cls

alias of FormHandlerPluginDoesNotExist

type

alias of FormHandlerPlugin

class fobi.base.FormHandlerPluginWidget(plugin)[source]

Bases: fobi.base.BasePluginWidget

Form handler plugin widget.

storage

alias of FormHandlerPluginWidgetDataStorage

class fobi.base.FormHandlerPluginWidgetRegistry[source]

Bases: fobi.base.BasePluginWidgetRegistry

Registry of form handler plugins.

type

alias of FormHandlerPluginWidget

class fobi.base.FormWizardHandlerPlugin(user=None)[source]

Bases: fobi.base.BasePlugin

Form wizard handler plugin.

Property fobi.base.FormWizardHandlerPluginDataStorage storage:
 
Property bool allow_multiple:
 If set to True, plugin can be used multiple times within (per form). Otherwise - just once.

DONE

allow_multiple = True
custom_actions(form_wizard_entry, request=None)[source]

Custom actions.

Override this method in your form handler if you want to specify custom actions. Note, that expected return value of this method is an iterable with a triple, where the first item is the URL of the action and the second item is the action title and the third item is the icon class of the action.

Example:
>>>  return (
>>>      ('/add-to-favorites/',
>>>       'Add to favourites',
>>>       'glyphicon glyphicon-favourties'),
>>>  )
get_custom_actions(form_wizard_entry, request=None)[source]

Internal method to for obtaining the get_custom_actions.

run(form_wizard_entry, request, form_list, form_wizard, form_element_entries=None)[source]

Run.

Custom code should be implemented here.

Parameters:
  • form_wizard_entry (fobi.models.FormEntry) – Instance of fobi.models.FormEntry.
  • request (django.http.HttpRequest) –
  • form (django.forms.Form) –
  • form_element_entries (iterable) – Iterable of fobi.models.FormElementEntry objects.
Return mixed:

May be a tuple (bool, mixed) or None

storage

alias of FormWizardHandlerPluginDataStorage

class fobi.base.FormWizardHandlerPluginDataStorage[source]

Bases: fobi.base.BaseDataStorage

Storage for FormWizardHandlerPlugin handler data.

class fobi.base.FormWizardHandlerPluginRegistry[source]

Bases: fobi.base.BaseRegistry

Form wizard handler plugins registry.

fail_on_missing_plugin = True
plugin_not_found_exception_cls

alias of FormWizardHandlerPluginDoesNotExist

type

alias of FormWizardHandlerPlugin

class fobi.base.FormWizardHandlerPluginWidget(plugin)[source]

Bases: fobi.base.BasePluginWidget

Form wizard handler plugin widget.

storage

alias of FormWizardHandlerPluginWidgetDataStorage

class fobi.base.FormWizardHandlerPluginWidgetRegistry[source]

Bases: fobi.base.BasePluginWidgetRegistry

Registry of form wizard handler plugins.

type

alias of FormWizardHandlerPluginWidget

fobi.base.get_form_element_plugin_widget(plugin_uid, request=None, as_instance=False, theme=None)[source]

Get the form element plugin widget for the plugin_uid given.

Parameters:
  • plugin_uid (str) – UID of the plugin to get the widget for.
  • request (django.http.HttpRequest) –
  • as_instance (bool) –
  • theme (fobi.base.BaseTheme) – Subclass of.
Return BasePluginWidget:
 

Subclass of.

fobi.base.get_form_handler_plugin_widget(plugin_uid, request=None, as_instance=False, theme=None)[source]

Get the form handler plugin widget for the plugin_uid given.

Parameters:
  • plugin_uid (str) – UID of the plugin to get the widget for.
  • request (django.http.HttpRequest) –
  • as_instance (bool) –
  • theme (fobi.base.BaseTheme) – Subclass of.
Return BasePluginWidget:
 

Subclass of.

fobi.base.get_form_wizard_handler_plugin_widget(plugin_uid, request=None, as_instance=False, theme=None)[source]

Get the form wizard handler plugin widget for the plugin_uid given.

Parameters:
  • plugin_uid (str) – UID of the plugin to get the widget for.
  • request (django.http.HttpRequest) –
  • as_instance (bool) –
  • theme (fobi.base.BaseTheme) – Subclass of.
Return BasePluginWidget:
 

Subclass of.

fobi.base.get_ordered_form_handlers()

Get ordered form handler plugins.

Gets form handler plugins in the execution order as a sortable dictionary, which can be later on used to add real plugins to be executed.

Return fobi.data_structures.SortableDict:
 
fobi.base.get_ordered_form_wizard_handlers()

Get ordered form wizard_handler plugins.

Gets form wizard handler plugins in the execution order as a sortable dictionary, which can be later on used to add real plugins to be executed.

Return fobi.data_structures.SortableDict:
 
fobi.base.get_plugin_widget(registry, plugin_uid, request=None, as_instance=False, theme=None)[source]

Get the plugin widget for the plugin_uid given.

Looks up in the registry provided.

Parameters:
  • registry (fobi.base.BasePluginWidgetRegistry) – Subclass of.
  • plugin_uid (str) – UID of the plugin to get the widget for.
  • request (django.http.HttpRequest) –
  • as_instance (bool) –
  • theme (fobi.base.BaseTheme) – Subclass of.
Return BasePluginWidget:
 

Subclass of.

fobi.base.get_processed_form_data(form, form_element_entries)[source]

Gets processed form data.

Simply fires both fobi.base.get_cleaned_data and fobi.base.get_field_name_to_label_map functions and returns the result.

Parameters:
  • form (django.forms.Form) –
  • form_element_entries (iterable) – Iterable of form element entries.
Return tuple:
fobi.base.get_processed_form_wizard_data(form_wizard, form_list, form_element_entries)[source]

Get processed form wizard data.

fobi.base.get_registered_form_callbacks(stage=None)[source]

Get registered form callbacks for the stage given.

fobi.base.get_registered_form_element_plugin_uids(flattern=True)[source]

Get registered form element plugin uids.

Gets a list of registered plugins in a form if tuple (plugin name, plugin description). If not yet auto-discovered, auto-discovers them.

Return list:
fobi.base.get_registered_form_element_plugins()[source]

Get registered form element plugins.

Gets a list of registered plugins in a form if tuple (plugin name, plugin description). If not yet auto-discovered, auto-discovers them.

Return list:
fobi.base.get_registered_form_handler_plugin_uids(flattern=True)[source]

Get registered form handler plugin uids.

Gets a list of UIDs of registered form handler plugins. If not yet auto-discovered, auto-discovers them.

Return list:
fobi.base.get_registered_form_handler_plugins(as_instances=False)[source]

Get registered form handler plugins.

Gets a list of registered plugins in a form of tuple (plugin name, plugin description). If not yet auto-discovered, auto-discovers them.

Return list:
fobi.base.get_registered_form_wizard_handler_plugin_uids(flattern=True)[source]

Get registered form handler plugin uids.

Gets a list of UIDs of registered form wizard handler plugins. If not yet auto-discovered, auto-discovers them.

Return list:
fobi.base.get_registered_form_wizard_handler_plugins(as_instances=False)[source]

Get registered form handler wizard plugins.

Gets a list of registered plugins in a form of tuple (plugin name, plugin description). If not yet auto-discovered, auto-discovers them.

Return list:
fobi.base.get_registered_integration_form_element_plugin_uids(flattern=True)[source]

Get registered custom field instance plugin uids.

Gets a list of registered plugins in a form if tuple (plugin name, plugin description). If not yet auto-discovered, auto-discovers them.

Return list:
fobi.base.get_registered_integration_form_element_plugins()[source]

Get registered custom field instance plugins.

Gets a list of registered plugins in a form if tuple (plugin name, plugin description). If not yet auto-discovered, auto-discovers them.

Return list:
fobi.base.get_registered_integration_form_element_plugins_grouped()[source]

Get registered custom field instance plugins grouped.

Gets a list of registered plugins in a form if tuple (plugin name, plugin description). If not yet auto-discovered, auto-discovers them.

Return dict:
fobi.base.get_registered_integration_form_handler_plugin_uids(flattern=True)[source]

Get registered integration form handler plugin uids.

Gets a list of registered plugins in a form if tuple (plugin name, plugin description). If not yet auto-discovered, auto-discovers them.

Return list:
fobi.base.get_registered_integration_form_handler_plugins()[source]

Get registered integration form handler plugins.

Gets a list of registered plugins in a form if tuple (plugin name, plugin description). If not yet auto-discovered, auto-discovers them.

Return list:
fobi.base.get_registered_integration_form_handler_plugins_grouped()[source]

Get registered integration form handler plugins grouped.

Gets a list of registered plugins in a form if tuple (plugin name, plugin description). If not yet auto-discovered, auto-discovers them.

Return dict:
fobi.base.get_registered_plugin_uids(registry, flattern=True, sort_items=True)[source]

Get a list of registered plugin uids as a list .

If not yet auto-discovered, auto-discovers them.

The sort_items is applied only if flattern is True.

Parameters:
  • registry
  • flattern (bool) –
  • sort_items (bool) –
Return list:
fobi.base.get_registered_plugins(registry, as_instances=False, sort_items=True)[source]

Get registered plugins.

Get a list of registered plugins in a form if tuple (plugin name, plugin description). If not yet auto-discovered, auto-discovers them.

Parameters:
  • registry
  • as_instances (bool) –
  • sort_items (bool) –
Return list:
fobi.base.get_registered_theme_uids(flattern=True)[source]

Get registered theme uids.

Gets a list of registered themes in a form of tuple (plugin name, plugin description). If not yet auto-discovered, auto-discovers them.

Return list:
fobi.base.get_registered_themes()[source]

Get registered themes.

Gets a list of registered themes in form of tuple (plugin name, plugin description). If not yet auto-discovered, auto-discovers them.

Return list:
class fobi.base.IntegrationFormElementPlugin(user=None)[source]

Bases: fobi.base.BasePlugin

Base custom field instance plugin for integration.

has_value = False
is_hidden = False
storage

alias of IntegrationFormElementPluginDataStorage

class fobi.base.IntegrationFormElementPluginDataStorage[source]

Bases: fobi.base.BaseDataStorage

Storage for IntegrationFormElementPlugin.

class fobi.base.IntegrationFormElementPluginProcessor(*args, **kwargs)[source]

Bases: object

Custom form field instance processor.

Supposed to have implemented a single method called process_custom_form_field_instance.

process_custom_form_field_instance(form_element_entry, form_entry, request, form_element_plugin)[source]

You should implement this method in your implementation.

class fobi.base.IntegrationFormElementPluginRegistry[source]

Bases: fobi.base.BaseIntegrationPluginRegistry

Integration form element plugin registry.

fail_on_missing_plugin = False
plugin_not_found_exception_cls

alias of IntegrationFormElementPluginDoesNotExist

type = (<class 'fobi.base.IntegrationFormElementPlugin'>,)
class fobi.base.IntegrationFormFieldPlugin(user=None)[source]

Bases: fobi.base.IntegrationFormElementPlugin

Integration form field plugin for custom field instances.

has_value = True
class fobi.base.IntegrationFormHandlerPlugin(user=None)[source]

Bases: fobi.base.BasePlugin

Base integration form handler plugin for integration.

has_value = True
is_hidden = False
storage

alias of IntegrationFormHandlerPluginDataStorage

class fobi.base.IntegrationFormHandlerPluginDataStorage[source]

Bases: fobi.base.BaseDataStorage

Storage for IntegrationFormHandlerPlugin.

class fobi.base.IntegrationFormHandlerPluginRegistry[source]

Bases: fobi.base.BaseIntegrationPluginRegistry

Integration form handler plugin registry.

fail_on_missing_plugin = False
plugin_not_found_exception_cls

alias of IntegrationFormHandlerPluginDoesNotExist

type = (<class 'fobi.base.IntegrationFormHandlerPlugin'>,)
class fobi.base.IntegrationFormCallbackRegistry[source]

Bases: object

Registry of callbacks for integration plugins.

Holds callbacks for stages listed in the fobi.constants.CALLBACK_STAGES.

get_callbacks(integrate_with, stage=None)[source]

Get callbacks for the stage given.

Parameters:
  • integrate_with (str) –
  • stage (string) –
Return list:
register(cls)[source]

Registers the plugin in the registry.

Parameters:cls (mixed) –
registry
uidfy(cls)[source]

Makes a UID string from the class given.

Parameters:cls (mixed) –
Return string:
class fobi.base.IntegrationFormCallback[source]

Bases: object

Integration form callback.

callback(form_entry, request, **kwargs)[source]

Callback.

Custom callback code should be implemented here.

Parameters:
  • form_entry (fobi.models.FormEntry) – Instance of fobi.models.FormEntry.
  • request (django.http.HttpRequest) –
  • form (django.forms.Form) –
integrate_with = None
fobi.base.run_form_handlers(form_entry, request, form, form_element_entries=None)[source]

Run form handlers.

Parameters:
  • form_entry (fobi.models.FormEntry) –
  • request (django.http.HttpRequest) –
  • form (django.forms.Form) –
  • form_element_entries (iterable) –
Return tuple:

List of success responses, list of error responses

fobi.base.run_form_wizard_handlers(form_wizard_entry, request, form_list, form_wizard, form_element_entries=None)[source]

Run form wizard handlers.

Parameters:
Return tuple:

List of success responses, list of error responses

fobi.base.validate_form_element_plugin_uid(plugin_uid)[source]

Validate the form element plugin uid.

Parameters:plugin_uid (string) –
Return bool:
fobi.base.validate_form_handler_plugin_uid(plugin_uid)[source]

Validate the plugin uid.

Parameters:plugin_uid (string) –
Return bool:
fobi.base.validate_form_wizard_handler_plugin_uid(plugin_uid)[source]

Validate the plugin uid.

Parameters:plugin_uid (string) –
Return bool:
fobi.base.validate_integration_form_element_plugin_uid(plugin_uid)[source]

Validate the custom field instance plugin uid.

Parameters:plugin_uid (string) –
Return bool:
fobi.base.validate_integration_form_handler_plugin_uid(plugin_uid)[source]

Validate the integration form handler plugin uid.

Parameters:plugin_uid (string) –
Return bool:
fobi.base.validate_theme_uid(plugin_uid)[source]

Validate the theme uid.

Parameters:plugin_uid (string) –
Return bool:

fobi.compat module

class fobi.compat.User(*args, **kwargs)[source]

Bases: django.contrib.auth.models.AbstractUser

Users within the Django authentication system are represented by this model.

Username, password and email are required. Other fields are optional.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception User.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

User.formelement_set

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

pizza.toppings and topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

User.formentry_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

User.formhandler_set

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

pizza.toppings and topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

User.formwizardentry_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

User.formwizardhandler_set

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

pizza.toppings and topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

User.get_next_by_date_joined(*moreargs, **morekwargs)
User.get_previous_by_date_joined(*moreargs, **morekwargs)
User.groups

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

pizza.toppings and topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

User.id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

User.logentry_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

User.registrationprofile

Accessor to the related object on the reverse side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

place.restaurant is a ReverseOneToOneDescriptor instance.

User.savedformdataentry_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

User.savedformwizarddataentry_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

User.user_permissions

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

pizza.toppings and topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

fobi.conf module

fobi.conf.get_setting(setting, override=None)[source]

Get setting.

Get a setting from fobi conf module, falling back to the default.

If override is not None, it will be used instead of the setting.

Parameters:
  • setting – String with setting name
  • override – Value to use when no setting is available. Defaults to None.
Returns:

Setting value.

fobi.constants module

fobi.context_processors module

fobi.context_processors.dynamic_values(request)[source]

Dynamic values exposed to public forms.

fobi.context_processors.form_importers(request)[source]

Form importers.

fobi.context_processors.theme(request)[source]

Get active theme.

Parameters:request (django.http.HttpRequest) –
Return fobi.base.BaseTheme:
 Instance of fobi.base.BaseTheme.

fobi.data_structures module

class fobi.data_structures.SortableDict(data=None)[source]

Bases: dict

SortableDict.

A dictionary that keeps its keys in the order in which they’re inserted. Very similar to (and partly based on) SortedDict of the Django, but has several additional methods implemented, such as: insert_before_key and insert_after_key.

clear()[source]

Clear.

copy()[source]

Returns a copy of this object.

insert(index, key, value)[source]

Inserts the key, value pair before the item with the given index.

insert_after_key(target_key, key, value, fail_silently=True)[source]

Insert the {key: value} after the target_key.

Parameters:
  • target_key (immutable) –
  • key (immutable) –
  • value (mutable) –
  • fail_silently (boolean) –
  • offset (int) –
Return bool:
insert_before_key(target_key, key, value, fail_silently=True, offset=0)[source]

Insert the {key: value} before the target_key.

Parameters:
  • target_key (immutable) –
  • key (immutable) –
  • value (mutable) –
  • fail_silently (boolean) –
  • offset (int) –
Return bool:
items()[source]
iteritems()

Iter items (internal method).

iterkeys()
itervalues()

Iter values (internal method).

keys()[source]
move_after_key(source_key, target_key, fail_silently=True)[source]

Move the {key: value} after the given source_key.

Parameters:
  • source_key (immutable) –
  • target_key (immutable) –
  • fail_silently (boolean) –
Return bool:
move_before_key(source_key, target_key, fail_silently=True, offset=0)[source]

Move the {key: value} before the given source_key.

Parameters:
  • source_key (immutable) –
  • target_key (immutable) –
  • fail_silently (boolean) –
  • offset (int) –
Return bool:
pop(key, *args)[source]

Pop.

popitem()[source]

Pop item.

setdefault(key, default)[source]

Set default.

update(dict_)[source]

Update.

value_for_index(index)[source]

Returns the value of the item at the given zero-based index.

values()[source]

fobi.decorators module

fobi.decorators.permissions_required(perms, satisfy='all', login_url=None, raise_exception=False)[source]

Check for the permissions given based on the strategy chosen.

Parameters:
  • perms (iterable) –
  • satisfy (string) – Allowed values are “all” and “any”.
  • login_url (string) –
  • raise_exception (bool) – If set to True, the PermissionDenied exception is raised on failures.
Return bool:
Example:
>>> @login_required
>>> @permissions_required(satisfy='any', perms=[
>>>     'fobi.add_formentry',
>>>     'fobi.change_formentry',
>>>     'fobi.delete_formentry',
>>>     'fobi.add_formelemententry',
>>>     'fobi.change_formelemententry',
>>>     'fobi.delete_formelemententry',
>>> ])
>>> def edit_dashboard(request):
>>>     # your code
fobi.decorators.all_permissions_required(perms, login_url=None, raise_exception=False)[source]

Check for the permissions given based on SATISFY_ALL strategy chosen.

Example:
>>> @login_required
>>> @all_permissions_required([
>>>     'fobi.add_formentry',
>>>     'fobi.change_formentry',
>>>     'fobi.delete_formentry',
>>>     'fobi.add_formelemententry',
>>>     'fobi.change_formelemententry',
>>>     'fobi.delete_formelemententry',
>>> ])
>>> def edit_dashboard(request):
>>>     # your code
fobi.decorators.any_permission_required(perms, login_url=None, raise_exception=False)[source]

Check for the permissions given based on SATISFY_ANY strategy chosen.

Example:
>>> @login_required
>>> @any_permission_required([
>>>     'fobi.add_formentry',
>>>     'fobi.change_formentry',
>>>     'fobi.delete_formentry',
>>>     'fobi.add_formelemententry',
>>>     'fobi.change_formelemententry',
>>>     'fobi.delete_formelemententry',
>>> ])
>>> def edit_dashboard(request):
>>>     # your code

fobi.defaults module

fobi.discover module

fobi.discover.autodiscover()[source]

Auto-discovers files that should be found by fobi.

fobi.dynamic module

fobi.dynamic.assemble_form_class(form_entry, base_class=<class 'django.forms.forms.BaseForm'>, request=None, origin=None, origin_kwargs_update_func=None, origin_return_func=None, form_element_entries=None, get_form_field_instances_kwargs={})[source]

Assemble a form class by given entry.

Parameters:
  • form_entry
  • base_class
  • request (django.http.HttpRequest) –
  • origin (string) –
  • origin_kwargs_update_func (callable) –
  • origin_return_func (callable) –
  • form_element_entries (iterable) – If given, used instead of form_entry.formelemententry_set.all (no additional database hit).
  • get_form_field_instances_kwargs (dict) – To be passed as **kwargs to the :method:`get_form_field_instances_kwargs`.
fobi.dynamic.assemble_form_wizard_class(form_wizard_entry, base_class=<class 'formtools.wizard.views.SessionWizardView'>, request=None, origin=None, origin_kwargs_update_func=None, origin_return_func=None, form_wizard_form_entries=None, template_name=None)[source]

Assemble form wizard class.

fobi.exceptions module

exception fobi.exceptions.BaseException[source]

Bases: exceptions.Exception

Base exception.

exception fobi.exceptions.DoesNotExist[source]

Bases: fobi.exceptions.BaseException

Raised when something does not exist.

exception fobi.exceptions.FormCallbackError[source]

Bases: fobi.exceptions.FormPluginError

Raised when form callback error occurs.

exception fobi.exceptions.FormElementPluginDoesNotExist[source]

Bases: fobi.exceptions.PluginDoesNotExist

Raised when no form element plugin with given uid can be found.

exception fobi.exceptions.FormElementPluginError[source]

Bases: fobi.exceptions.FormPluginError

Raised when form element plugin error occurs.

exception fobi.exceptions.FormHandlerPluginDoesNotExist[source]

Bases: fobi.exceptions.PluginDoesNotExist

Raised when no form handler plugin with given uid can be found.

exception fobi.exceptions.FormHandlerPluginError[source]

Bases: fobi.exceptions.FormPluginError

Raised when form handler plugin error occurs.

exception fobi.exceptions.FormPluginError[source]

Bases: fobi.exceptions.BaseException

Base error for form elements and handlers.

exception fobi.exceptions.FormWizardHandlerPluginDoesNotExist[source]

Bases: fobi.exceptions.PluginDoesNotExist

FormWizardHandlerPlugin does not exist.

Raised when no form wizard handler plugin with given uid can be found.

exception fobi.exceptions.ImproperlyConfigured[source]

Bases: fobi.exceptions.BaseException

Improperly configured.

Exception raised when developer didn’t configure/write the code properly.

exception fobi.exceptions.IntegrationFormElementPluginDoesNotExist[source]

Bases: fobi.exceptions.PluginDoesNotExist

If integration form element plugin with given uid can’t be found.

exception fobi.exceptions.IntegrationFormHandlerPluginDoesNotExist[source]

Bases: fobi.exceptions.PluginDoesNotExist

If integration form handler plugin with given uid can’t be found.

exception fobi.exceptions.InvalidRegistryItemType[source]

Bases: exceptions.ValueError, fobi.exceptions.BaseException

Invalid registry item type.

Raised when an attempt is made to register an item in the registry which does not have a proper type.

exception fobi.exceptions.NoDefaultThemeSet[source]

Bases: fobi.exceptions.ImproperlyConfigured

Raised when no active theme is chosen.

exception fobi.exceptions.PluginDoesNotExist[source]

Bases: fobi.exceptions.DoesNotExist

Raised when no plugin with given uid can be found.

exception fobi.exceptions.ThemeDoesNotExist[source]

Bases: fobi.exceptions.DoesNotExist

Raised when no theme with given uid can be found.

fobi.form_importers module

class fobi.form_importers.BaseFormImporter(form_entry_cls, form_element_entry_cls, form_properties=None, form_data=None)[source]

Bases: object

Base importer.

description = None
extract_field_properties(field_data)[source]

Extract field properties.

field_properties_mapping = None
field_type_prop_name = None
fields_mapping = None
get_form_data()[source]

Get form data.

get_template_names()[source]

Get template names.

get_wizard(request, *args, **kwargs)[source]

Get wizard.

import_data(form_properties, form_data)[source]

Import data.

name = None
position_prop_name = None
templates = None
uid = None
wizard = None
class fobi.form_importers.FormImporterPluginRegistry[source]

Bases: fobi.base.BaseRegistry

Form importer plugins registry.

type

alias of BaseFormImporter

fobi.form_importers.ensure_autodiscover()[source]

Ensure that form importer plugins are auto-discovered.

fobi.form_importers.get_form_importer_plugin_uids()[source]

Get form importer plugin uids.

fobi.form_importers.get_form_impoter_plugin_urls()[source]

Gets the form importer plugin URLs as a list of tuples.

fobi.form_utils module

class fobi.form_utils.ErrorDict[source]

Bases: django.forms.utils.ErrorDict

A better ErrorDict.

as_text()[source]

As text.

class fobi.form_utils.ErrorList(initlist=None, error_class=None)[source]

Bases: django.forms.utils.ErrorList

A better ErrorList.

as_text()[source]

As text.

fobi.forms module

class fobi.forms.BulkChangeFormElementPluginsForm(*args, **kwargs)[source]

Bases: fobi.forms.BaseBulkChangePluginsForm

Bulk change form element plugins form.

class Meta[source]

Bases: object

Meta class.

fields = ['groups', 'groups_action', 'users', 'users_action']
model

alias of FormElement

BulkChangeFormElementPluginsForm.base_fields = OrderedDict([('groups', <django.forms.models.ModelMultipleChoiceField object at 0x7f6c0df9a290>), ('groups_action', <django.forms.fields.ChoiceField object at 0x7f6c0df8cf10>), ('users', <django.forms.models.ModelMultipleChoiceField object at 0x7f6c0df9a0d0>), ('users_action', <django.forms.fields.ChoiceField object at 0x7f6c0df8cdd0>), ('selected_plugins', <django.forms.fields.CharField object at 0x7f6c0df8ccd0>)])
BulkChangeFormElementPluginsForm.declared_fields = OrderedDict([('selected_plugins', <django.forms.fields.CharField object at 0x7f6c0df8ccd0>), ('users_action', <django.forms.fields.ChoiceField object at 0x7f6c0df8cdd0>), ('groups_action', <django.forms.fields.ChoiceField object at 0x7f6c0df8cf10>)])
BulkChangeFormElementPluginsForm.media
class fobi.forms.BulkChangeFormHandlerPluginsForm(*args, **kwargs)[source]

Bases: fobi.forms.BaseBulkChangePluginsForm

Bulk change form handler plugins form.

class Meta[source]

Bases: object

Meta class.

fields = ['groups', 'groups_action', 'users', 'users_action']
model

alias of FormHandler

BulkChangeFormHandlerPluginsForm.base_fields = OrderedDict([('groups', <django.forms.models.ModelMultipleChoiceField object at 0x7f6c0df9a750>), ('groups_action', <django.forms.fields.ChoiceField object at 0x7f6c0df8cf10>), ('users', <django.forms.models.ModelMultipleChoiceField object at 0x7f6c0df9a510>), ('users_action', <django.forms.fields.ChoiceField object at 0x7f6c0df8cdd0>), ('selected_plugins', <django.forms.fields.CharField object at 0x7f6c0df8ccd0>)])
BulkChangeFormHandlerPluginsForm.declared_fields = OrderedDict([('selected_plugins', <django.forms.fields.CharField object at 0x7f6c0df8ccd0>), ('users_action', <django.forms.fields.ChoiceField object at 0x7f6c0df8cdd0>), ('groups_action', <django.forms.fields.ChoiceField object at 0x7f6c0df8cf10>)])
BulkChangeFormHandlerPluginsForm.media
class fobi.forms.BulkChangeFormWizardHandlerPluginsForm(*args, **kwargs)[source]

Bases: fobi.forms.BaseBulkChangePluginsForm

Bulk change form wizard handler plugins form.

class Meta[source]

Bases: object

Meta class.

fields = ['groups', 'groups_action', 'users', 'users_action']
model

alias of FormWizardHandler

BulkChangeFormWizardHandlerPluginsForm.base_fields = OrderedDict([('groups', <django.forms.models.ModelMultipleChoiceField object at 0x7f6c0df9ac50>), ('groups_action', <django.forms.fields.ChoiceField object at 0x7f6c0df8cf10>), ('users', <django.forms.models.ModelMultipleChoiceField object at 0x7f6c0df9aa10>), ('users_action', <django.forms.fields.ChoiceField object at 0x7f6c0df8cdd0>), ('selected_plugins', <django.forms.fields.CharField object at 0x7f6c0df8ccd0>)])
BulkChangeFormWizardHandlerPluginsForm.declared_fields = OrderedDict([('selected_plugins', <django.forms.fields.CharField object at 0x7f6c0df8ccd0>), ('users_action', <django.forms.fields.ChoiceField object at 0x7f6c0df8cdd0>), ('groups_action', <django.forms.fields.ChoiceField object at 0x7f6c0df8cf10>)])
BulkChangeFormWizardHandlerPluginsForm.media
fobi.forms.FormElementEntryFormSet

alias of FormElementEntryFormFormSet

class fobi.forms.FormEntryForm(*args, **kwargs)[source]

Bases: django.forms.models.ModelForm

Form for fobi.models.FormEntry model.

class Meta[source]

Bases: object

Meta class.

fields = ('name', 'title', 'is_public', 'success_page_title', 'success_page_message', 'action')
model

alias of FormEntry

FormEntryForm.base_fields = OrderedDict([('name', <django.forms.fields.CharField object at 0x7f6c0e98bb50>), ('title', <django.forms.fields.CharField object at 0x7f6c0e98bc10>), ('is_public', <django.forms.fields.BooleanField object at 0x7f6c0e98be90>), ('success_page_title', <django.forms.fields.CharField object at 0x7f6c0e98e4d0>), ('success_page_message', <django.forms.fields.CharField object at 0x7f6c0e98e390>), ('action', <django.forms.fields.CharField object at 0x7f6c0e90f550>)])
FormEntryForm.clean_action()[source]

Validate the action (URL).

Checks if URL exists.

FormEntryForm.declared_fields = OrderedDict()
FormEntryForm.media
class fobi.forms.FormFieldsetEntryForm(*args, **kwargs)[source]

Bases: django.forms.models.ModelForm

Form for fobi.models.FormFieldsetEntry model.

class Meta[source]

Bases: object

Meta class.

fields = ('name',)
model

alias of FormFieldsetEntry

FormFieldsetEntryForm.base_fields = OrderedDict([('name', <django.forms.fields.CharField object at 0x7f6c0e90f7d0>)])
FormFieldsetEntryForm.declared_fields = OrderedDict()
FormFieldsetEntryForm.media
class fobi.forms.FormHandlerEntryForm(data=None, files=None, auto_id=u'id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, instance=None, use_required_attribute=None)[source]

Bases: django.forms.models.ModelForm

FormHandlerEntry form.

class Meta[source]

Bases: object

Meta class.

fields = ('form_entry', 'plugin_data', 'plugin_uid')
model

alias of FormHandlerEntry

FormHandlerEntryForm.base_fields = OrderedDict([('form_entry', <django.forms.models.ModelChoiceField object at 0x7f6c0dffab50>), ('plugin_data', <django.forms.fields.CharField object at 0x7f6c0dffaad0>), ('plugin_uid', <django.forms.fields.ChoiceField object at 0x7f6c0dffa610>)])
FormHandlerEntryForm.declared_fields = OrderedDict([('plugin_uid', <django.forms.fields.ChoiceField object at 0x7f6c0dffa610>)])
FormHandlerEntryForm.media
class fobi.forms.FormHandlerForm(data=None, files=None, auto_id=u'id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, instance=None, use_required_attribute=None)[source]

Bases: django.forms.models.ModelForm

FormHandler form.

class Meta[source]

Bases: object

Meta class.

fields = ('users', 'groups')
model

alias of FormHandler

FormHandlerForm.base_fields = OrderedDict([('users', <django.forms.models.ModelMultipleChoiceField object at 0x7f6c0dffa690>), ('groups', <django.forms.models.ModelMultipleChoiceField object at 0x7f6c0dffa850>)])
FormHandlerForm.declared_fields = OrderedDict()
FormHandlerForm.media
class fobi.forms.FormWizardEntryForm(*args, **kwargs)[source]

Bases: django.forms.models.ModelForm

Form for fobi.models.FormWizardEntry model.

class Meta[source]

Bases: object

Meta class.

fields = ('name', 'title', 'is_public', 'success_page_title', 'success_page_message', 'show_all_navigation_buttons')
model

alias of FormWizardEntry

FormWizardEntryForm.base_fields = OrderedDict([('name', <django.forms.fields.CharField object at 0x7f6c0df8c4d0>), ('title', <django.forms.fields.CharField object at 0x7f6c0df8c5d0>), ('is_public', <django.forms.fields.BooleanField object at 0x7f6c0df8c6d0>), ('success_page_title', <django.forms.fields.CharField object at 0x7f6c0df8c750>), ('success_page_message', <django.forms.fields.CharField object at 0x7f6c0df8c890>), ('show_all_navigation_buttons', <django.forms.fields.BooleanField object at 0x7f6c0df8c910>)])
FormWizardEntryForm.declared_fields = OrderedDict()
FormWizardEntryForm.media
class fobi.forms.FormWizardFormEntryForm(data=None, files=None, auto_id=u'id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, instance=None, use_required_attribute=None)[source]

Bases: django.forms.models.ModelForm

FormWizardFormEntryForm form.

class Meta[source]

Bases: object

Meta class.

fields = ('form_wizard_entry', 'form_entry')
model

alias of FormWizardFormEntry

FormWizardFormEntryForm.base_fields = OrderedDict([('form_wizard_entry', <django.forms.models.ModelChoiceField object at 0x7f6c0dffadd0>), ('form_entry', <django.forms.models.ModelChoiceField object at 0x7f6c0dffafd0>)])
FormWizardFormEntryForm.declared_fields = OrderedDict()
FormWizardFormEntryForm.media
fobi.forms.FormWizardFormEntryFormSet

alias of FormWizardFormEntryFormFormSet

class fobi.forms.FormWizardHandlerEntryForm(data=None, files=None, auto_id=u'id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, instance=None, use_required_attribute=None)[source]

Bases: django.forms.models.ModelForm

FormWizardHandlerEntry form.

class Meta[source]

Bases: object

Meta class.

fields = ('form_wizard_entry', 'plugin_data', 'plugin_uid')
model

alias of FormWizardHandlerEntry

FormWizardHandlerEntryForm.base_fields = OrderedDict([('form_wizard_entry', <django.forms.models.ModelChoiceField object at 0x7f6c0df8cb50>), ('plugin_data', <django.forms.fields.CharField object at 0x7f6c0df8cad0>), ('plugin_uid', <django.forms.fields.ChoiceField object at 0x7f6c0df8c410>)])
FormWizardHandlerEntryForm.declared_fields = OrderedDict([('plugin_uid', <django.forms.fields.ChoiceField object at 0x7f6c0df8c410>)])
FormWizardHandlerEntryForm.media
class fobi.forms.ImportFormEntryForm(data=None, files=None, auto_id=u'id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None)[source]

Bases: django.forms.forms.Form

Import form entry form.

base_fields = OrderedDict([('file', <django.forms.fields.FileField object at 0x7f6c0df9ae10>)])
declared_fields = OrderedDict([('file', <django.forms.fields.FileField object at 0x7f6c0df9ae10>)])
media
class fobi.forms.ImportFormWizardEntryForm(data=None, files=None, auto_id=u'id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None)[source]

Bases: fobi.forms.ImportFormEntryForm

Import form entry wizard form.

base_fields = OrderedDict([('file', <django.forms.fields.FileField object at 0x7f6c0df9ae10>)])
declared_fields = OrderedDict([('file', <django.forms.fields.FileField object at 0x7f6c0df9ae10>)])
media

fobi.helpers module

Helpers module. This module can be safely imported from any fobi (sub)module, since it never imports from any of the fobi (sub)modules (except for the fobi.constants and fobi.exceptions modules).

fobi.helpers.admin_change_url(app_label, module_name, object_id, extra_path='', url_title=None)[source]

Gets an admin change URL for the object given.

Parameters:
  • app_label (str) –
  • module_name (str) –
  • object_id (int) –
  • extra_path (str) –
  • url_title (str) – If given, an HTML a tag is returned with url_title as the tag title. If left to None just the URL string is returned.
Return str:
fobi.helpers.clean_dict(source, keys=[], values=[])[source]

Removes given keys and values from dictionary.

Parameters:
  • source (dict) –
  • keys (iterable) –
  • values (iterable) –
Return dict:
fobi.helpers.clone_file(upload_dir, source_filename, relative_path=True)[source]

Clones the file.

Parameters:source_filename (string) – Source filename.
Return string:Filename of the cloned file.
fobi.helpers.combine_dicts(headers, data)[source]

Combine dicts.

Takes two dictionaries, assuming one contains a mapping keys to titles and another keys to data. Joins as string and returns a result dict.

fobi.helpers.delete_file(image_file)[source]

Delete file from disc.

fobi.helpers.do_slugify(val)[source]

Slugify.

fobi.helpers.ensure_unique_filename(destination)[source]

Makes sure filenames are never overwritten.

Parameters:destination (string) –
Return string:
fobi.helpers.flatatt_inverse_quotes(attrs)[source]

Convert a dictionary of attributes to a single string.

The returned string will contain a leading space followed by key=”value”, XML-style pairs. In the case of a boolean value, the key will appear without a value. It is assumed that the keys do not need to be XML-escaped. If the passed dictionary is empty, then return an empty string.

The result is passed through ‘mark_safe’ (by way of ‘format_html_join’).

fobi.helpers.get_app_label_and_model_name(path)[source]

Gets app_label and model_name from the path given.

Parameters:path (str) – Dotted path to the model (without ”.model”, as stored in the Django ContentType model.
Return tuple:app_label, model_name
fobi.helpers.get_form_element_entries_for_form_wizard_entry(form_wizard_entry)[source]

Get form element entries for the form wizard entry.

fobi.helpers.get_model_name_for_object(obj)[source]

Get model name for object.

Django version agnostic.

fobi.helpers.get_registered_models(ignore=[])[source]

Gets registered models as list.

Parameters:ignore (iterable) – Ignore the following content types (should be in app_label.model format (example auth.User).
Return list:
fobi.helpers.get_select_field_choices(raw_choices_data, key_type=None, value_type=None, fail_silently=True)[source]

Get select field choices.

Used in radio, select and other choice based fields.

Parameters:
  • raw_choices_data (str) –
  • key_type (type) –
  • value_type (type) –
  • fail_silently (bool) –
Return list:
fobi.helpers.get_wizard_form_field_value_from_post(request, wizard_view_name, form_key, field_name, fail_silently=True)[source]

Get wizard form field value from POST.

This is what we could have:

>>> request.POST
>>> {
>>>     'csrfmiddlewaretoken': ['kEprTL218a8HNcC02QefNNnF'],
>>>     'slider-form-test_slider': ['14'],
>>>     'form_wizard_view-current_step': ['slider-form'],
>>>     'slider-form-test_email': ['user@example.com']
>>> }

Note, that we know nothing about the types here, type conversion should be done manually. The values returned are strings always.

Parameters:
  • request (django.http.HttpRequest) –
  • wizard_view_name (str) –
  • form_key (str) – Typically, this would be the step name (form slug).
  • field_name (str) – Field name.
  • fail_silently (bool) – If set to True, no errors raised.
Return str:

Since everything in session is stored as string.

fobi.helpers.get_wizard_form_field_value_from_request(request, wizard_view_name, form_key, field_name, fail_silently=True, session_priority=False)[source]

Get wizard form field value from request.

Note, that we know nothing about the types here, type conversion should be done manually. The values returned are strings always.

Parameters:
  • request (django.http.HttpRequest) –
  • wizard_view_name (str) –
  • form_key (str) – Typically, this would be the step name (form slug).
  • field_name (str) – Field name.
  • fail_silently (bool) – If set to True, no errors raised.
  • session_priority (bool) – If set to True, first try to read from session.
Return str:

Since everything in session is stored as string.

fobi.helpers.get_wizard_form_field_value_from_session(request, wizard_view_name, form_key, field_name, fail_silently=True)[source]

Get wizard form field value from session.

This is what we could have:

>>> request.session['wizard_form_wizard_view']['step_data']
>>> {
>>>     'slider-form': {
>>>         'csrfmiddlewaretoken': ['DhINThGTgQ50e2lDnGG4nYrG0a'],
>>>         'slider-form-test_slider': ['14'],
>>>         'form_wizard_view-current_step': ['slider-form'],
>>>         'slider-form-test_email': ['user@example.com']
>>>     }
>>> }

Note, that we know nothing about the types here, type conversion should be done manually. The values returned are strings always.

Parameters:
  • request (django.http.HttpRequest) –
  • wizard_view_name (str) –
  • form_key (str) – Typically, this would be the step name (form slug).
  • field_name (str) – Field name.
  • fail_silently (bool) – If set to True, no errors raised.
Return str:

Since everything in session is stored as string.

fobi.helpers.handle_uploaded_file(upload_dir, image_file)[source]

Handle uploaded files.

Parameters:image_file (django.core.files.uploadedfile.InMemoryUploadedFile) –
Return string:Path to the image (relative).
fobi.helpers.iterable_to_dict(items, key_attr_name)[source]

Converts iterable of certain objects to dict.

Parameters:
  • items (iterable) –
  • key_attr_name (string) – Attribute to use as a dictionary key.
Return dict:
class fobi.helpers.JSONDataExporter(data, filename)[source]

Bases: object

Exporting the data into JSON.

export()[source]

Export.

export_to_json()[source]

Export data to JSON.

fobi.helpers.lists_overlap(sub, main)[source]

Check whether lists overlap.

fobi.helpers.map_field_name_to_label(form)[source]

Takes a form and creates label to field name map.

Parameters:form (django.forms.Form) – Instance of django.forms.Form.
Return dict:
fobi.helpers.safe_text(text)[source]

Safe text (encode).

Return str:
class fobi.helpers.StrippedRequest(request)[source]

Bases: object

Stripped request object.

META

Request meta stripped down.

A standard Python dictionary containing all available HTTP headers. Available headers depend on the client and server, but here are some examples:

  • HTTP_ACCEPT_ENCODING: Acceptable encodings for the response.
  • HTTP_ACCEPT_LANGUAGE: Acceptable languages for the response.
  • HTTP_HOST: The HTTP Host header sent by the client.
  • HTTP_REFERER: The referring page, if any.
  • HTTP_USER_AGENT: The clients user-agent string.
  • QUERY_STRING: The query string, as a single (unparsed) string.
  • REMOTE_ADDR: The IP address of the client.
get_full_path()[source]

Returns the path, plus an appended query string, if applicable.

is_ajax()[source]

Is ajax?

Returns True if the request was made via an XMLHttpRequest, by checking the HTTP_X_REQUESTED_WITH header for the string ‘XMLHttpRequest’.

is_secure()[source]

Is secure.

Returns True if the request is secure; that is, if it was made with HTTPS.

path

Path.

A string representing the full path to the requested page, not including the scheme or domain.

class fobi.helpers.StrippedUser(user)[source]

Bases: object

Stripped user object.

email

Email.

get_full_name()[source]

Get full name.

get_short_name()[source]

Get short name.

get_username()[source]

Get username.

is_anonymous()[source]

Is anonymous.

fobi.helpers.two_dicts_to_string(headers, data, html_element='p')[source]

Two dicts to string.

Takes two dictionaries, assuming one contains a mapping keys to titles and another keys to data. Joins as string and returns wrapped into HTML “p” tag.

fobi.helpers.uniquify_sequence(sequence)[source]

Uniqify sequence.

Makes sure items in the given sequence are unique, having the original order preserved.

Parameters:sequence (iterable) –
Return list:
fobi.helpers.update_plugin_data(entry, request=None)[source]

Update plugin data.

Update plugin data of a given entry.

fobi.helpers.validate_initial_for_choices(plugin_form, field_name_choices='choices', field_name_initial='initial')[source]

Validate init for choices. Validates the initial value for the choices given.

Parameters:
Return str:
fobi.helpers.validate_initial_for_multiple_choices(plugin_form, field_name_choices='choices', field_name_initial='initial')[source]

Validates the initial value for the multiple choices given.

Parameters:
Return str:
fobi.helpers.validate_submit_value_as(value)[source]

Validates the SUBMIT_AS_VALUE.

Parameters:value (str) –

fobi.models module

class fobi.models.AbstractPluginModel(*args, **kwargs)[source]

Bases: django.db.models.base.Model

Abstract plugin model.

Used when fobi.settings.RESTRICT_PLUGIN_ACCESS is set to True.

Properties:
  • plugin_uid (str): Plugin UID.
  • users (django.contrib.auth.models.User): White list of the users allowed to use the plugin.
  • groups (django.contrib.auth.models.Group): White list of the user groups allowed to use the plugin.
class Meta[source]

Bases: object

Meta class.

abstract = False
AbstractPluginModel.get_registered_plugins()[source]

Get registered plugins.

AbstractPluginModel.groups

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

pizza.toppings and topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

AbstractPluginModel.groups_list()[source]

Groups list.

Flat list (comma separated string) of groups allowed to use the plugin. Used in Django admin.

Return string:
AbstractPluginModel.plugin_uid_admin()[source]

Plugin uid admin.

Mainly used in admin.

AbstractPluginModel.plugin_uid_code()[source]

Plugin uid code.

Mainly used in admin.

AbstractPluginModel.users

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

pizza.toppings and topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

AbstractPluginModel.users_list()[source]

Users list.

Flat list (comma separated string) of users allowed to use the plugin. Used in Django admin.

Return string:
class fobi.models.FormElement(*args, **kwargs)[source]

Bases: fobi.models.AbstractPluginModel

Form element.

Form field plugin. Used when fobi.settings.RESTRICT_PLUGIN_ACCESS is set to True.

Properties:
  • plugin_uid (str): Plugin UID.
  • users (django.contrib.auth.models.User): White list of the users allowed to use the form element plugin.
  • groups (django.contrib.auth.models.Group): White list of the user groups allowed to use the form element plugin.
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception FormElement.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

FormElement.get_registered_plugins()[source]

Add choices.

FormElement.groups

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

pizza.toppings and topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

FormElement.id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

FormElement.objects = <django.db.models.manager.Manager object>
FormElement.plugin_uid

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

FormElement.users

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

pizza.toppings and topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

class fobi.models.FormHandler(*args, **kwargs)[source]

Bases: fobi.models.AbstractPluginModel

Form handler plugin. Used when fobi.settings.RESTRICT_PLUGIN_ACCESS is set to True.

Properties:
  • plugin_uid (str): Plugin UID.
  • users (django.contrib.auth.models.User): White list of the users allowed to use the form handler plugin.
  • groups (django.contrib.auth.models.Group): White list of the user groups allowed to use the form handler plugin.
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception FormHandler.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

FormHandler.get_registered_plugins()[source]

Add choices.

FormHandler.groups

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

pizza.toppings and topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

FormHandler.id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

FormHandler.objects = <django.db.models.manager.Manager object>
FormHandler.plugin_uid

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

FormHandler.users

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

pizza.toppings and topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

class fobi.models.FormWizardHandler(*args, **kwargs)[source]

Bases: fobi.models.AbstractPluginModel

Form wizard handler plugin. Used when fobi.settings.RESTRICT_PLUGIN_ACCESS is set to True.

Properties:
  • plugin_uid (str): Plugin UID.
  • users (django.contrib.auth.models.User): White list of the users allowed to use the form handler plugin.
  • groups (django.contrib.auth.models.Group): White list of the user groups allowed to use the form handler plugin.
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception FormWizardHandler.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

FormWizardHandler.get_registered_plugins()[source]

Add choices.

FormWizardHandler.groups

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

pizza.toppings and topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

FormWizardHandler.id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

FormWizardHandler.objects = <django.db.models.manager.Manager object>
FormWizardHandler.plugin_uid

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

FormWizardHandler.users

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

pizza.toppings and topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

class fobi.models.BaseAbstractPluginEntry(*args, **kwargs)[source]

Bases: django.db.models.base.Model

Base for AbstractPluginEntry.

Properties:
  • plugin_data (str): JSON formatted string with plugin data.
class Meta[source]

Bases: object

Meta class.

abstract = False
BaseAbstractPluginEntry.entry_user

Get user from the parent container.

BaseAbstractPluginEntry.get_plugin(fetch_related_data=False, request=None)[source]

Get plugin.

Gets the plugin class (by plugin_uid property), makes an instance of it, serves the data stored in plugin_data field (if available). Once all is done, plugin is ready to be rendered.

Parameters:fetch_related_data (bool) – When set to True, plugin is told to re-fetch all related data (stored in models or other sources).
Return fobi.base.BasePlugin:
 Subclass of fobi.base.BasePlugin.
BaseAbstractPluginEntry.get_registered_plugins()[source]

Get registered plugins.

BaseAbstractPluginEntry.get_registry()[source]

Get registry.

BaseAbstractPluginEntry.plugin_data

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

BaseAbstractPluginEntry.plugin_name()[source]

Plugin name.

BaseAbstractPluginEntry.plugin_uid_code()[source]

Plugin uid code.

Mainly used in admin.

class fobi.models.AbstractPluginEntry(*args, **kwargs)[source]

Bases: fobi.models.BaseAbstractPluginEntry

Abstract plugin entry.

Properties:
  • form_entry (fobi.models.FormEntry): Form to which the field plugin belongs to.
  • plugin_uid (str): Plugin UID.
  • plugin_data (str): JSON formatted string with plugin data.
class Meta[source]

Bases: object

Meta class.

abstract = False
AbstractPluginEntry.entry_user

Get user.

AbstractPluginEntry.form_entry

Accessor to the related object on the forward side of a many-to-one or one-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

child.parent is a ForwardManyToOneDescriptor instance.

AbstractPluginEntry.form_entry_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class fobi.models.FormWizardEntry(*args, **kwargs)[source]

Bases: django.db.models.base.Model

Form wizard entry.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception FormWizardEntry.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

FormWizardEntry.created

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

FormWizardEntry.formwizardformentry_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

FormWizardEntry.formwizardhandlerentry_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

FormWizardEntry.get_absolute_url()[source]

Get absolute URL.

Absolute URL, which goes to the form-wizard view view.

Return string:
FormWizardEntry.get_wizard_type_display(*moreargs, **morekwargs)
FormWizardEntry.id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

FormWizardEntry.is_cloneable

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

FormWizardEntry.is_public

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

FormWizardEntry.name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

FormWizardEntry.objects = <django.db.models.manager.Manager object>
FormWizardEntry.savedformwizarddataentry_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

FormWizardEntry.show_all_navigation_buttons

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

FormWizardEntry.slug

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

FormWizardEntry.success_page_message

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

FormWizardEntry.success_page_title

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

FormWizardEntry.title

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

FormWizardEntry.updated

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

FormWizardEntry.user

Accessor to the related object on the forward side of a many-to-one or one-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

child.parent is a ForwardManyToOneDescriptor instance.

FormWizardEntry.user_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

FormWizardEntry.wizard_type

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class fobi.models.FormEntry(*args, **kwargs)[source]

Bases: django.db.models.base.Model

Form entry.

Properties:
  • user (django.contrib.auth.models.User: User owning the plugin.
  • name (str): Form name.
  • title (str): Form title - used in templates.
  • slug (str): Form slug.
  • description (str): Form description.
  • is_public (bool): If set to True, is visible to public.
  • is_cloneable (bool): If set to True, is cloneable.
  • position (int): Ordering position in the wizard.
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception FormEntry.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

FormEntry.action

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

FormEntry.created

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

FormEntry.formelemententry_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

FormEntry.formfieldsetentry_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

FormEntry.formhandlerentry_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

FormEntry.formwizardformentry_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

FormEntry.get_absolute_url()[source]

Get absolute URL.

Absolute URL, which goes to the form-entry view view page.

Return string:
FormEntry.id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

FormEntry.is_cloneable

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

FormEntry.is_public

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

FormEntry.name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

FormEntry.objects = <django.db.models.manager.Manager object>
FormEntry.savedformdataentry_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

FormEntry.slug

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

FormEntry.success_page_message

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

FormEntry.success_page_title

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

FormEntry.title

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

FormEntry.updated

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

FormEntry.user

Accessor to the related object on the forward side of a many-to-one or one-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

child.parent is a ForwardManyToOneDescriptor instance.

FormEntry.user_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class fobi.models.FormElementEntry(*args, **kwargs)[source]

Bases: fobi.models.AbstractPluginEntry

Form field entry.

Properties:
  • form (fobi.models.FormEntry): Form to which the field plugin belongs to.
  • plugin_uid (str): Plugin UID.
  • plugin_data (str): JSON formatted string with plugin data.
  • form_fieldset_entry: Fieldset.
  • position (int): Entry position.
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception FormElementEntry.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

FormElementEntry.form_entry

Accessor to the related object on the forward side of a many-to-one or one-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

child.parent is a ForwardManyToOneDescriptor instance.

FormElementEntry.form_fieldset_entry

Accessor to the related object on the forward side of a many-to-one or one-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

child.parent is a ForwardManyToOneDescriptor instance.

FormElementEntry.form_fieldset_entry_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

FormElementEntry.get_registered_plugins()[source]

Gets registered plugins.

FormElementEntry.get_registry()[source]

Get registry.

FormElementEntry.id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

FormElementEntry.objects = <django.db.models.manager.Manager object>
FormElementEntry.plugin_uid

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

FormElementEntry.position

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class fobi.models.FormFieldsetEntry(*args, **kwargs)[source]

Bases: django.db.models.base.Model

Form fieldset entry.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception FormFieldsetEntry.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

FormFieldsetEntry.form_entry

Accessor to the related object on the forward side of a many-to-one or one-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

child.parent is a ForwardManyToOneDescriptor instance.

FormFieldsetEntry.form_entry_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

FormFieldsetEntry.formelemententry_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

FormFieldsetEntry.id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

FormFieldsetEntry.is_repeatable

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

FormFieldsetEntry.name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

FormFieldsetEntry.objects = <django.db.models.manager.Manager object>
class fobi.models.FormHandlerEntry(*args, **kwargs)[source]

Bases: fobi.models.AbstractPluginEntry

Form handler entry.

Properties:
  • form_entry (fobi.models.FormEntry): Form to which the handler plugin belongs to.
  • plugin_uid (str): Plugin UID.
  • plugin_data (str): JSON formatted string with plugin data.
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception FormHandlerEntry.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

FormHandlerEntry.form_entry

Accessor to the related object on the forward side of a many-to-one or one-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

child.parent is a ForwardManyToOneDescriptor instance.

FormHandlerEntry.get_registered_plugins()[source]

Gets registered plugins.

FormHandlerEntry.get_registry()[source]

Get registry.

FormHandlerEntry.id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

FormHandlerEntry.objects = <django.db.models.manager.Manager object>
FormHandlerEntry.plugin_uid

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class fobi.models.AbstractFormWizardPluginEntry(*args, **kwargs)[source]

Bases: fobi.models.BaseAbstractPluginEntry

Abstract form wizard plugin entry.

Properties:
  • form_entry (fobi.models.FormWizardEntry): FormWizard to which the plugin belongs to.
  • plugin_uid (str): Plugin UID.
  • plugin_data (str): JSON formatted string with plugin data.
class Meta[source]

Bases: object

Meta class.

abstract = False
AbstractFormWizardPluginEntry.entry_user

Get user.

AbstractFormWizardPluginEntry.form_wizard_entry

Accessor to the related object on the forward side of a many-to-one or one-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

child.parent is a ForwardManyToOneDescriptor instance.

AbstractFormWizardPluginEntry.form_wizard_entry_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class fobi.models.FormWizardHandlerEntry(*args, **kwargs)[source]

Bases: fobi.models.AbstractFormWizardPluginEntry

Form wizard handler entry.

Properties:
  • form_wizard_entry (fobi.models.FormWizardEntry): FormWizard to which the handler plugin belongs to.
  • plugin_uid (str): Plugin UID.
  • plugin_data (str): JSON formatted string with plugin data.
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception FormWizardHandlerEntry.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

FormWizardHandlerEntry.form_wizard_entry

Accessor to the related object on the forward side of a many-to-one or one-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

child.parent is a ForwardManyToOneDescriptor instance.

FormWizardHandlerEntry.get_registered_plugins()[source]

Gets registered plugins.

FormWizardHandlerEntry.get_registry()[source]

Get registry.

FormWizardHandlerEntry.id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

FormWizardHandlerEntry.objects = <django.db.models.manager.Manager object>
FormWizardHandlerEntry.plugin_uid

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

fobi.settings module

  • RESTRICT_PLUGIN_ACCESS (bool): If set to True, (Django) permission system for fobi plugins is enabled.
  • FORM_ELEMENT_PLUGINS_MODULE_NAME (str): Name of the module to placed in the (external) apps in which the fobi form element plugin code should be implemented and registered.
  • FORM_HANDLER_PLUGINS_MODULE_NAME (str): Name of the module to placed in the (external) apps in which the fobi form handler plugin code should be implemented and registered.
  • FORM_CALLBACKS_MODULE_NAME (str): Name of the module to placed in the (external) apps in which the fobi form callback code should be implemented and registered.
  • FORM_HANDLER_PLUGINS_EXECUTION_ORDER (tuple): Order in which the form handler plugins are to be executed.
  • FORM_WIZARD_HANDLER_PLUGINS_EXECUTION_ORDER (tuple): Order in which the form handler plugins are to be executed.
  • DEBUG

fobi.test module

fobi.utils module

Another helper module. This module can NOT be safely imported from any fobi (sub)module - thus should be imported carefully.

fobi.utils.get_allowed_plugin_uids(plugin_model_cls, user)[source]

Get allowed plugins uids for user given.

Parameters:
Return list:
fobi.utils.get_user_plugins(get_allowed_plugin_uids_func, get_registered_plugins_func, registry, user)[source]

Get user plugins.

Gets a list of user plugins in a form if tuple (plugin name, plugin description). If not yet autodiscovered, autodiscovers them.

Parameters:
  • get_allowed_plugin_uids_func (callable) –
  • get_registered_plugins_func (callable) –
  • registry (fobi.base.BaseRegistry) – Subclass of fobi.base.BaseRegistry instance.
  • user (django.contrib.auth.models.User) –
Return list:
fobi.utils.get_user_plugin_uids(get_allowed_plugin_uids_func, get_registered_plugin_uids_func, registry, user)[source]

Gets a list of user plugin uids as a list.

If not yet auto-discovered, auto-discovers them.

Parameters:
  • get_allowed_plugin_uids_func (callable) –
  • get_registered_plugin_uids_func (callable) –
  • registry (fobi.base.BaseRegistry) – Subclass of fobi.base.BaseRegistry instance.
  • user (django.contrib.auth.models.User) –
Return list:
fobi.utils.sync_plugins()[source]

Sync registered plugins.

Syncs the registered plugin list with data in fobi.models.FormFieldPluginModel, fobi.models.FormHandlerPluginModel and fobi.models.FormWizardHandlerPluginModel.

fobi.utils.get_allowed_form_element_plugin_uids(user)[source]

Get allowed form element plugin uids.

fobi.utils.get_user_form_element_plugins(user)[source]

Get user form element plugins.

fobi.utils.get_user_form_element_plugin_uids(user)[source]

Get user form element plugin uids.

fobi.utils.get_allowed_form_handler_plugin_uids(user)[source]

Get allowed form handler plugin uids.

fobi.utils.get_allowed_form_wizard_handler_plugin_uids(user)[source]

Get allowed form wizard handler plugin uids.

fobi.utils.get_user_form_handler_plugins(user, exclude_used_singles=False, used_form_handler_plugin_uids=[])[source]

Get list of plugins allowed for user.

Parameters:
  • user (django.contrib.auth.models.User) –
  • exclude_used_singles (bool) –
  • used_form_handler_plugin_uids (list) –
Return list:
fobi.utils.get_user_form_wizard_handler_plugins(user, exclude_used_singles=False, used_form_wizard_handler_plugin_uids=[])[source]

Get list of plugins allowed for user.

Parameters:
  • user (django.contrib.auth.models.User) –
  • exclude_used_singles (bool) –
  • used_form_wizard_handler_plugin_uids (list) –
Return list:
fobi.utils.get_user_form_handler_plugin_uids(user)[source]

Get user form handler plugin uids.

fobi.utils.get_user_form_wizard_handler_plugin_uids(user)[source]

Get user form handler plugin uids.

fobi.utils.get_user_plugins_grouped(get_allowed_plugin_uids_func, get_registered_plugins_grouped_func, registry, user, sort_items=True)[source]

Get user plugins grouped.

Parameters:
  • get_allowed_plugin_uids_func (callable) –
  • get_registered_plugins_grouped_func (callable) –
  • registry (fobi.base.BaseRegistry) – Subclass of fobi.base.BaseRegistry instance.
  • user (django.contrib.auth.models.User) –
  • sort_items (bool) –
Return dict:
fobi.utils.get_user_form_element_plugins_grouped(user)[source]

Get user form element plugins grouped.

fobi.utils.get_user_form_handler_plugins_grouped(user)[source]

Get user form handler plugins grouped.

fobi.utils.get_user_form_wizard_handler_plugins_grouped(user)[source]

Get user form wizard handler plugins grouped.

fobi.utils.prepare_form_entry_export_data(form_entry, form_element_entries=None, form_handler_entries=None)[source]

Prepare form entry export data.

Parameters:
  • form_entry (fobi.modes.FormEntry) – Instance of.
  • form_element_entries (django.db.models.QuerySet) – QuerySet of FormElementEntry instances.
  • form_handler_entries (django.db.models.QuerySet) – QuerySet of FormHandlerEntry instances.
Return str:
fobi.utils.perform_form_entry_import(request, form_data)[source]

Perform form entry import.

Parameters:
  • request (django.http.HttpRequest) –
  • form_data (dict) –

:return :class:`fobi.modes.FormEntry: Instance of.

fobi.validators module

fobi.validators.url_exists(url, local=False)[source]

Check if URL exists.

Parameters:
  • url (str) –
  • local (bool) –
Return bool:

fobi.views module

Views.

fobi.views.add_form_element_entry(request, *args, **kwargs)[source]

Add form element entry.

Parameters:
  • request (django.http.HttpRequest) –
  • form_entry_id (int) –
  • form_element_plugin_uid (int) –
  • theme (fobi.base.BaseTheme) – Theme instance.
  • template_name (string) –
Return django.http.HttpResponse:
 
fobi.views.add_form_handler_entry(request, *args, **kwargs)[source]

Add form handler entry.

Parameters:
  • request (django.http.HttpRequest) –
  • form_entry_id (int) –
  • form_handler_plugin_uid (int) –
  • theme (fobi.base.BaseTheme) – Theme instance.
  • template_name (string) –
Return django.http.HttpResponse:
 
fobi.views.add_form_wizard_form_entry(request, *args, **kwargs)[source]

Add form wizard form entry.

Parameters:
  • request (django.http.HttpRequest) –
  • form_wizard_entry_id (int) –
  • form_entry_id (int) –
  • theme (fobi.base.BaseTheme) – Theme instance.
  • template_name (string) –
Return django.http.HttpResponse:
 
fobi.views.add_form_wizard_handler_entry(request, *args, **kwargs)[source]

Add form handler entry.

Parameters:
  • request (django.http.HttpRequest) –
  • form_entry_id (int) –
  • form_handler_plugin_uid (int) –
  • theme (fobi.base.BaseTheme) – Theme instance.
  • template_name (string) –
Return django.http.HttpResponse:
 
fobi.views.create_form_entry(request, *args, **kwargs)[source]

Create form entry.

Parameters:
  • request (django.http.HttpRequest) –
  • theme (fobi.base.BaseTheme) – Theme instance.
  • template_name (str) –
Return django.http.HttpResponse:
 
fobi.views.create_form_wizard_entry(request, *args, **kwargs)[source]

Create form wizard entry.

Parameters:
  • request (django.http.HttpRequest) –
  • theme (fobi.base.BaseTheme) – Theme instance.
  • template_name (str) –
Return django.http.HttpResponse:
 
fobi.views.dashboard(request, *args, **kwargs)[source]

Dashboard.

Parameters:
  • request (django.http.HttpRequest) –
  • theme (fobi.base.BaseTheme) – Theme instance.
  • template_name (string) –
Return django.http.HttpResponse:
 
fobi.views.delete_form_element_entry(request, *args, **kwargs)[source]

Delete form element entry.

Parameters:
  • request (django.http.HttpRequest) –
  • form_element_entry_id (int) –
Return django.http.HttpResponse:
 
fobi.views.delete_form_entry(request, *args, **kwargs)[source]

Delete form entry.

Parameters:
  • request (django.http.HttpRequest) –
  • form_entry_id (int) –
  • template_name (string) –
Return django.http.HttpResponse:
 
fobi.views.delete_form_handler_entry(request, *args, **kwargs)[source]

Delete form handler entry.

Parameters:
  • request (django.http.HttpRequest) –
  • form_handler_entry_id (int) –
Return django.http.HttpResponse:
 
fobi.views.delete_form_wizard_entry(request, *args, **kwargs)[source]

Delete form wizard entry.

Parameters:
  • request (django.http.HttpRequest) –
  • form_wizard_entry_id (int) –
  • template_name (string) –
Return django.http.HttpResponse:
 
fobi.views.delete_form_wizard_form_entry(request, *args, **kwargs)[source]

Delete form wizard form entry.

Parameters:
  • request (django.http.HttpRequest) –
  • form_wizard_form_entry_id (int) –
Return django.http.HttpResponse:
 
fobi.views.edit_form_element_entry(request, *args, **kwargs)[source]

Edit form element entry.

Parameters:
  • request (django.http.HttpRequest) –
  • form_element_entry_id (int) –
  • theme (fobi.base.BaseTheme) – Theme instance.
  • template_name (string) –
Return django.http.HttpResponse:
 
fobi.views.edit_form_entry(request, *args, **kwargs)[source]

Edit form entry.

Parameters:
  • request (django.http.HttpRequest) –
  • form_entry_id (int) –
  • theme (fobi.base.BaseTheme) – Theme instance.
  • template_name (str) –
Return django.http.HttpResponse:
 
fobi.views.edit_form_handler_entry(request, *args, **kwargs)[source]

Edit form handler entry.

Parameters:
  • request (django.http.HttpRequest) –
  • form_handler_entry_id (int) –
  • theme (fobi.base.BaseTheme) – Theme instance.
  • template_name (string) –
Return django.http.HttpResponse:
 
fobi.views.edit_form_wizard_handler_entry(request, *args, **kwargs)[source]

Edit form handler entry.

Parameters:
  • request (django.http.HttpRequest) –
  • form_wizard_handler_entry_id (int) –
  • theme (fobi.base.BaseTheme) – Theme instance.
  • template_name (string) –
Return django.http.HttpResponse:
 
fobi.views.export_form_entry(request, *args, **kwargs)[source]

Export form entry to JSON.

Parameters:
  • request (django.http.HttpRequest) –
  • form_entry_id (int) –
  • template_name (string) –
Return django.http.HttpResponse:
 
fobi.views.form_entry_submitted(request, form_entry_slug=None, template_name=None)[source]

Form entry submitted.

Parameters:
  • request (django.http.HttpRequest) –
  • form_entry_slug (string) –
  • template_name (string) –
Return django.http.HttpResponse:
 
fobi.views.form_importer(request, *args, **kwargs)[source]

Form importer.

Parameters:
  • request (django.http.HttpRequest) –
  • form_importer_plugin_uid (str) –
  • template_name (str) –
fobi.views.form_wizard_entry_submitted(request, form_wizard_entry_slug=None, template_name=None)[source]

Form wizard entry submitted.

Parameters:
  • request (django.http.HttpRequest) –
  • form_wizard_entry_slug (string) –
  • template_name (string) –
Return django.http.HttpResponse:
 
fobi.views.form_wizards_dashboard(request, *args, **kwargs)[source]

Dashboard for form wizards.

Parameters:
  • request (django.http.HttpRequest) –
  • theme (fobi.base.BaseTheme) – Theme instance.
  • template_name (string) –
Return django.http.HttpResponse:
 
class fobi.views.FormWizardView(**kwargs)[source]

Bases: fobi.wizard.views.dynamic.DynamicSessionWizardView

Dynamic form wizard.

done(form_list, **kwargs)[source]

Done.

file_storage = <django.core.files.storage.FileSystemStorage object>
get_context_data(form, **kwargs)[source]

Get context data.

get_form_entry_for_step(step)[source]

Get form entry title for step.

get_ignorable_field_names(form_element_entries)[source]

Get ignorable field names.

get_initial_wizard_data(request, *args, **kwargs)[source]

Get initial wizard data.

post(*args, **kwargs)[source]

POST requests.

This method handles POST requests.

The wizard will render either the current step (if form validation wasn’t successful), the next step (if the current step was stored successful) or the done view (if no more steps are available)

render_done(form, **kwargs)[source]

Render done.

This method gets called when all forms passed. The method should also re-validate all steps to prevent manipulation. If any form fails to validate, render_revalidation_failure should get called. If everything is fine call done.

fobi.views.import_form_entry(request, *args, **kwargs)[source]

Import form entry.

Parameters:
  • request (django.http.HttpRequest) –
  • template_name (string) –
Return django.http.HttpResponse:
 
fobi.views.import_form_wizard_entry(request, *args, **kwargs)[source]

Import form wizard entry.

Parameters:
  • request (django.http.HttpRequest) –
  • template_name (string) –
Return django.http.HttpResponse:
 
fobi.views.view_form_entry(request, form_entry_slug, theme=None, template_name=None)[source]

View created form.

Parameters:
  • request (django.http.HttpRequest) –
  • form_entry_slug (string) –
  • theme (fobi.base.BaseTheme) – Theme instance.
  • template_name (string) –
Return django.http.HttpResponse:
 

fobi.widgets module

class fobi.widgets.NumberInput(attrs=None)[source]

Bases: django.forms.widgets.TextInput

input_type = u'number'
media
class fobi.widgets.BooleanRadioSelect(*args, **kwargs)[source]

Bases: django.forms.widgets.RadioSelect

Boolean radio select for Django.

Example:
>>> class DummyForm(forms.Form):
>>>     agree = forms.BooleanField(label=_("Agree?"),
>>>                                required=False,
>>>                                widget=BooleanRadioSelect)
media
class fobi.widgets.RichSelect(attrs=None, choices=(), prepend_html=None, append_html=None, override_name=None)[source]

Bases: django.forms.widgets.Select

Rich select widget with some rich enhancements.

Based on original Select widget and intended to be a drop-off replacement.

media
render(name, value, attrs=None)[source]

Renders the element, having prepended and appended extra parts.

class fobi.widgets.RichSelectInverseQuotes(attrs=None, choices=(), prepend_html=None, append_html=None, override_name=None)[source]

Bases: fobi.widgets.RichSelect

Almost same as original, but uses alternative flatatt function.

Uses inverse quotes.

media
render(name, value, attrs=None)[source]

Module contents

Quick start

Tutorial for very quick start with django-fobi. Consists of several parts listed below:

- Part 1: Standard Django installation
- Part 2: Integration with DjangoCMS (coming soon)

Part 1: standard Django installation

Example project code available here.

Installation and configuration
Install the package in your environment.
pip install django-fobi
INSTALLED_APPS

Add fobi core and the plugins to the INSTALLED_APPS of the your settings module.

  1. The core.
'fobi',
  1. The preferred theme. Bootstrap 3 theme is the default. If you have chosen a different theme, update the value of FOBI_DEFAULT_THEME accordingly.
'fobi.contrib.themes.bootstrap3',
  1. The form field plugins. Plugins are like blocks. You are recommended to have them all installed. Note, that the following plugins do not have additional dependencies, while some others (like fobi.contrib.plugins.form_elements.security.captcha or fobi.contrib.plugins.form_elements.security.recaptcha would require additional packages to be installed. If so, make sure to have installed and configured those dependencies prior adding the dependant add-ons to the settings module.
'fobi.contrib.plugins.form_elements.fields.boolean',
'fobi.contrib.plugins.form_elements.fields.checkbox_select_multiple',
'fobi.contrib.plugins.form_elements.fields.date',
'fobi.contrib.plugins.form_elements.fields.date_drop_down',
'fobi.contrib.plugins.form_elements.fields.datetime',
'fobi.contrib.plugins.form_elements.fields.decimal',
'fobi.contrib.plugins.form_elements.fields.email',
'fobi.contrib.plugins.form_elements.fields.file',
'fobi.contrib.plugins.form_elements.fields.float',
'fobi.contrib.plugins.form_elements.fields.hidden',
'fobi.contrib.plugins.form_elements.fields.input',
'fobi.contrib.plugins.form_elements.fields.integer',
'fobi.contrib.plugins.form_elements.fields.ip_address',
'fobi.contrib.plugins.form_elements.fields.null_boolean',
'fobi.contrib.plugins.form_elements.fields.password',
'fobi.contrib.plugins.form_elements.fields.radio',
'fobi.contrib.plugins.form_elements.fields.regex',
'fobi.contrib.plugins.form_elements.fields.select',
'fobi.contrib.plugins.form_elements.fields.select_model_object',
'fobi.contrib.plugins.form_elements.fields.select_multiple',
'fobi.contrib.plugins.form_elements.fields.select_multiple_model_objects',
'fobi.contrib.plugins.form_elements.fields.slug',
'fobi.contrib.plugins.form_elements.fields.text',
'fobi.contrib.plugins.form_elements.fields.textarea',
'fobi.contrib.plugins.form_elements.fields.time',
'fobi.contrib.plugins.form_elements.fields.url',
  1. The presentational form elements (images, texts, videos).
'easy_thumbnails',  # Required by `content_image` plugin
'fobi.contrib.plugins.form_elements.content.content_image',
'fobi.contrib.plugins.form_elements.content.content_text',
'fobi.contrib.plugins.form_elements.content.content_video',
  1. Form handlers. Note, that some of them may require database sync/migration.
'fobi.contrib.plugins.form_handlers.db_store',
'fobi.contrib.plugins.form_handlers.http_repost',
'fobi.contrib.plugins.form_handlers.mail',

Putting all together, you would have something like this.

INSTALLED_APPS = (
    # Used by fobi
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'django.contrib.admin',

    # ...
    # Core
    'fobi',

    # Theme
    'fobi.contrib.themes.bootstrap3',

    # Form field plugins
    'fobi.contrib.plugins.form_elements.fields.boolean',
    'fobi.contrib.plugins.form_elements.fields.checkbox_select_multiple',
    'fobi.contrib.plugins.form_elements.fields.date',
    'fobi.contrib.plugins.form_elements.fields.date_drop_down',
    'fobi.contrib.plugins.form_elements.fields.datetime',
    'fobi.contrib.plugins.form_elements.fields.decimal',
    'fobi.contrib.plugins.form_elements.fields.email',
    'fobi.contrib.plugins.form_elements.fields.file',
    'fobi.contrib.plugins.form_elements.fields.float',
    'fobi.contrib.plugins.form_elements.fields.hidden',
    'fobi.contrib.plugins.form_elements.fields.input',
    'fobi.contrib.plugins.form_elements.fields.integer',
    'fobi.contrib.plugins.form_elements.fields.ip_address',
    'fobi.contrib.plugins.form_elements.fields.null_boolean',
    'fobi.contrib.plugins.form_elements.fields.password',
    'fobi.contrib.plugins.form_elements.fields.radio',
    'fobi.contrib.plugins.form_elements.fields.regex',
    'fobi.contrib.plugins.form_elements.fields.select',
    'fobi.contrib.plugins.form_elements.fields.select_model_object',
    'fobi.contrib.plugins.form_elements.fields.select_multiple',
    'fobi.contrib.plugins.form_elements.fields.select_multiple_model_objects',
    'fobi.contrib.plugins.form_elements.fields.slug',
    'fobi.contrib.plugins.form_elements.fields.text',
    'fobi.contrib.plugins.form_elements.fields.textarea',
    'fobi.contrib.plugins.form_elements.fields.time',
    'fobi.contrib.plugins.form_elements.fields.url',

    # Form element plugins
    'easy_thumbnails',  # Required by ``content_image`` plugin
    'fobi.contrib.plugins.form_elements.content.content_image',
    'fobi.contrib.plugins.form_elements.content.content_text',
    'fobi.contrib.plugins.form_elements.content.content_video',

    # Form handlers
    'fobi.contrib.plugins.form_handlers.db_store',
    'fobi.contrib.plugins.form_handlers.http_repost',
    'fobi.contrib.plugins.form_handlers.mail',

    # ...
)
TEMPLATE_CONTEXT_PROCESSORS

Add django.core.context_processors.request and fobi.context_processors.theme to TEMPLATE_CONTEXT_PROCESSORS of your settings module.

TEMPLATE_CONTEXT_PROCESSORS = (
    # ...
    "django.core.context_processors.request",
    "fobi.context_processors.theme",  # Obligatory
    "fobi.context_processors.dynamic_values",  # Optional
    # ...
)
urlpatterns

Add the following line to urlpatterns of your urls module.

urlpatterns = [
    # ...

    # DB Store plugin URLs
    url(r'^fobi/plugins/form-handlers/db-store/',
        include('fobi.contrib.plugins.form_handlers.db_store.urls')),

    # View URLs
    url(r'^fobi/', include('fobi.urls.view')),

    # Edit URLs
    url(r'^fobi/', include('fobi.urls.edit')),

    # ...
]
Update the database
  1. First you should be syncing/migrating the database. Depending on your Django version and migration app, this step may vary. Typically as follows:
./manage.py syncdb
./manage.py migrate --fake-initial
  1. Sync installed fobi plugins. Go to terminal and type the following command.
./manage.py fobi_sync_plugins
Specify the active theme

Specify the default theme in your settings module.

FOBI_DEFAULT_THEME = 'bootstrap3'
Permissions

fobi has been built with permissions in mind. Every single form element plugin or handler is permission based. If user hasn’t been given permission to work with a form element or a form handler plugin, he won’t be. If you want to switch the permission checks off, set the value of FOBI_RESTRICT_PLUGIN_ACCESS to False in your settings module.

FOBI_RESTRICT_PLUGIN_ACCESS = False

Otherwise, after having completed all the steps above, do log into the Django administration and assign the permissions (to certain user or a group) for every single form element or form handler plugin. Bulk assignments work as well.

Also, make sure to have the Django model permissions set for following models:

Part 2: Integration with DjangoCMS

Coming soon...

Release history and notes

Sequence based identifiers are used for versioning (schema follows below):

major.minor[.revision]
  • It’s always safe to upgrade within the same minor version (for example, from 0.3 to 0.3.4).
  • Minor version changes might be backwards incompatible. Read the release notes carefully before upgrading (for example, when upgrading from 0.3.4 to 0.4).
  • All backwards incompatible changes are mentioned in this document.

0.11.13

2017-06-10

  • Updated docs for DjangoCMS, FeinCMS and Mezzanine.
  • Updated outdated Dutch translations.
  • Improvements of the DRF integration app documentation.
  • Duration field added.
  • Support DurationField in drf_integration integration app.
  • Minor fixes in docs.

0.11.12

2017-05-31

  • Added a lot of field metadata to the OPTIONS call of drf_integration app.
  • Appended a lot of sub-module README files to the main documentation.

0.11.11

2017-05-29

  • Minor fixes in content_text drf_integration plugin.
  • Added imageurl support to the mailchimp_impoter plugin.

0.11.10

2017-05-26

  • Minor fixes in form-wizards on Django 1.11.

0.11.9

2017-05-24

  • Mezzanine integration updated to work with Mezzanine 4.2.3.
  • Fixes in date-drop-down plugin when using form wizards.

0.11.8

2017-05-17

  • ContentImageURL plugin added.
  • Minor Python3 fixes in db_store plugin (related to export of forms to xls format).

0.11.7

2017-05-16

  • Fixed in fobi.integration package related to Django 1.10 and higher.
  • FeinCMS integration updated (only migrations added) to work with FeinCMS 1.13.2.
  • DjangoCMS integration updated to work with DjangoCMS 3.4.3.

0.11.6

2017-05-15

  • Minor fixes in drf_integration app, added GET/detail actions tests.

0.11.5

2017-05-15

  • Added date_drop_down to drf_integration app.
  • Fixed dependencies issue.
  • Added dedicated requirements for specific Django versions.

0.11.4

2017-05-12

  • Minor fixes in integration callbacks of the drf_integration sub-package.
  • Added support for content_image, content_text and content_video plugins.
  • Fixes in installable demo.

0.11.3

2017-05-10

  • Concept of integration callbacks introduced and implemented for the drf_integration sub-package.

0.11.2

2017-05-09

  • Minor fixes in drf_integration app.

0.11.1

2017-05-08

  • Minor fixes in decimal plugin.
  • Minor documentation improvements.

0.11

2017-05-07

This release is dedicated to my beloved wife for all the love and support she gave me through years. If you are a company looking for (female) developers in Groningen area (the Netherlands), do not hesitate to contact her.

  • Django REST framework integration. Check the Heroku demo here.
  • Documentation fixes.
  • PEP8 code fixes.
  • Minor setup fixes related to moved screen-shots file.
  • Added helper scripts to test with Firefox in headless mode. Describe testing with Firefox in headless mode in documentation.
  • Validate the decimal field plugin - quantize the decimal value to the configured precision.
  • Minor fixes in the float field plugin.
  • Minor improvements in complex form element plugins (select, file) and form handler plugins (db_store, mail, http_respost) in order to simplify integration plugins and reduce code duplication.
  • Minor Python3 fixes in range_select and slider form element plugins.
  • Minor Python3 fixes in http_repost and mail form handler plugins.

0.10.7

2017-03-13

  • Several Django deprecation/moves fixes for better future compatibility.

0.10.6

2017-02-14

  • Minor Python 3 fixes for integer, float and decimal fields.

0.10.5

2017-02-13

  • Tested against Python 3.6.
  • Initial (experimental) Django 1.11 support.

0.10.4

2017-01-11

  • Minor fixes in Django admin.
  • Various pep8 fixes.
  • Fixes additions and improvements in/of docs.
  • Add options to test with PhantomJS instead of Firefox.

0.10.3

2016-11-24

  • Minor fixes.

0.10.2

2016-11-24

  • Minor fixes.

0.10.1

2016-11-17

  • Fixed captcha and re-captcha issues in form wizards.

0.10

2016-11-16

Note, that this release contains minor backwards incompatible changes, that may break your code. Two additional arguments have been added to the submit_plugin_form_data method of the form element plugins. If you have written custom form element plugins - update your code.

  • Added form_entry_elements and kwargs to the submit_plugin_form_data method of the form element plugins. Make sure to update your custom plugins if you have written any.
  • Added tests for mailchimp integration plugin.
  • Moving all plugins to base submodules of the correspondent sub packages.
  • Add missing whitespace to the help_text of the title field of FormEntry and FormWizardEntry models.
  • Disable GoogleAnalytics while testing (guess what - this change speeds up selenium tests twice).
  • Docs updated.
  • Helper scripts updated.
  • Multiple pep8 fixes.

0.9.17

2016-11-13

Announcing dropping support of Python 2.6 and Django 1.7. As of 0.9.17 everything is still backwards compatible with Django 1.7, but in future versions it will be wiped out.

  • Value validations for Integer and Text Fields.
  • Hide previous button in form wizard template for bootstrap3 on first step.

0.9.16

2016-11-10

  • Introduced form titles (shown in view templates).
  • Improved navigation of the form wizards.

0.9.15

2016-11-07

  • Minor fixes.

0.9.14

2016-11-07

  • Minor fixes.

0.9.13

2016-11-05

Announcing dropping support of Django 1.5 and 1.6. As of 0.9.17 everything is still backwards compatible with versions 1.5 and 1.6, but in future versions compatibility with these versions will be wiped out.

  • Fix backwards compatibility of slider and range_select plugins with Django versions 1.5 and 1.6.

0.9.12

2016-11-02

  • Better debugging.
  • Upgrade example FeinCMS integration to work with 1.12.

0.9.11

2016-11-01

  • Fixes.

0.9.10

2016-11-01

  • Fixed issue with custom labels in the slider plugin.
  • Made slider plugin compatible with Django <= 1.6.
  • Fixes get_absolute_url methods on FormEntry and FormWizardEntry models. #48

0.9.9

2016-10-31

  • Make it possible to add custom ticks to the slider plugin.

0.9.8

2016-10-27

  • Support multiple sliders in one form.

0.9.7

2016-10-27

  • Improvements in the generic integration processor. #47
  • Improved form wizard interface and navigation.
  • Fixed a broken test.
  • Added import/export functionality for form wizards.

0.9.6

2016-10-25

  • Fixed InvalidQuery exception raised when attempting to export entry from a ‘DB store’ handler. #44
  • Fixed ProgrammingError raised when using the ‘Export data to CSV/XLS’ action. #45

0.9.5

2016-10-25

  • Minor fixes in slider and select_range plugins.

0.9.4

2016-10-24

  • Fix issue with select_multiple, select_multiple_model_objects and select_multiple_mptt_model_objects being invalidated on the last step of the form wizard.

0.9.3

2016-10-24

  • Change to NumberInput widget for all number inputs.
  • Fixed issue with slider plugin missing labels if Show endpoints as is set to Labeled ticks.
  • Link to edit form entry added to edit form wizard entry view.

0.9.2

2016-10-24

  • Minor fixes.

0.9.1

2016-10-24

  • Minor fixes.

0.9

2016-10-24

Note, that this release contain minor backwards incompatible changes, that may break your existing code (your data is left intact). If you have written custom form element plugins you should update your code!

0.8.10

2016-10-22

  • Minor CSS improvements of the slider plugin.
  • Fixed broken readthedocs requirements.

0.8.9

2016-10-22

  • Simplified debugging (never set FOBI_DEBUG to True in production!).
  • Major slider plugin improvements.

0.8.8

2016-10-21

  • Minor slider plugin improvements (JavaScript).

0.8.7

2016-10-21

  • Fixed issue of plugin media not being collected in the form wizard.

0.8.6

2016-10-21

  • Functional improvements of slider plugin.

0.8.5

2016-10-20

  • Add range_select and slider form field plugins.
  • Fixed custom CSS classes not appearing in the rendered HTML of the field plugin/widget.
  • Fixed issue with undefined file storage for form wizards. From now on the FileSystemStorage storage is used for wizard uploads.
  • Fixed too much of extreme data view/export security of the db_store plugin.
  • Backwards compatibility fixes for Django < 1.7.

0.8.4

2016-10-19

  • Fix broken export (to JSON) of form entries.
  • Fix broken import (from JSON) of form entries.

0.8.3

2016-10-18

  • Minor fixes.

0.8.2

2016-10-18

  • Minor fixes.

0.8.1

2016-10-17

  • Minor fixes.

0.8

2016-10-17

Release supported by Lund University Cognitive Science.

  • Adding form-wizards functionality. Note, that at the moment only bootstrap3 theme was updated to filly support the form wizards. Although, all other themes would by default support form-wizard functionality, they may not look as nice as they should be (to be fixed in 0.8.x releases shortly).
  • The six package requirements increased to >= 1.8.
  • Tests comply with pep8.
  • Fixed recently broken drag-and-drop ordering of the form elements.
  • Fixed typo for HTML id “tab-form-elemenets” -> “tab-form-elements”. You may need to update your custom CSS/JS/HTML accordingly. See the listing 0.8.a for the files affected.
  • An additional property form_view_form_entry_option_class has been added to all the themes. Change your custom CSS/jS/HTML accordingly. See the listing 0.8.b for the files affected.
  • Fixed drag-and-drop not working for ordering of form elements. #43
  • Fixed issue with non-proper rendering of the form-importer templates.

Although this release does not contain backwards incompatible changes, there have been several changes in GUI and some parts of the generic HTML and themes were updated. If you have custom themes implemented, you should likely make some minor updates to the HTML in order to reflect the latest GUI changes. The following templates have been affected:

New files
  • src/fobi/contrib/plugins/form_handlers/db_store/templates/db_store/view_saved_form_wizard_data_entries.html
  • src/fobi/contrib/themes/bootstrap3/templates/bootstrap3/add_form_wizard_handler_entry.html
  • src/fobi/contrib/themes/bootstrap3/templates/bootstrap3/add_form_wizard_handler_entry_ajax.html
  • src/fobi/contrib/themes/bootstrap3/templates/bootstrap3/create_form_wizard_entry.html
  • src/fobi/contrib/themes/bootstrap3/templates/bootstrap3/create_form_wizard_entry_ajax.html
  • src/fobi/contrib/themes/bootstrap3/templates/bootstrap3/edit_form_wizard_entry.html
  • src/fobi/contrib/themes/bootstrap3/templates/bootstrap3/edit_form_wizard_entry_ajax.html
  • src/fobi/contrib/themes/bootstrap3/templates/bootstrap3/form_wizards_dashboard.html
  • src/fobi/contrib/themes/bootstrap3/templates/bootstrap3/snippets/form_wizard_ajax.html
  • src/fobi/contrib/themes/bootstrap3/templates/bootstrap3/snippets/form_wizard_properties_snippet.html
  • src/fobi/contrib/themes/bootstrap3/templates/bootstrap3/snippets/form_wizard_snippet.html
  • src/fobi/contrib/themes/bootstrap3/templates/bootstrap3/view_form_wizard_entry.html
  • src/fobi/contrib/themes/bootstrap3/templates/bootstrap3/view_form_wizard_entry_ajax.html
  • src/fobi/templates/fobi/generic/add_form_wizard_handler_entry.html
  • src/fobi/templates/fobi/generic/add_form_wizard_handler_entry_ajax.html
  • src/fobi/templates/fobi/generic/create_form_wizard_entry.html
  • src/fobi/templates/fobi/generic/create_form_wizard_entry_ajax.html
  • src/fobi/templates/fobi/generic/edit_form_wizard_entry.html
  • src/fobi/templates/fobi/generic/edit_form_wizard_entry_ajax.html
  • src/fobi/templates/fobi/generic/form_wizard_entry_submitted.html
  • src/fobi/templates/fobi/generic/form_wizard_entry_submitted_ajax.html
  • src/fobi/templates/fobi/generic/form_wizards_dashboard.html
  • src/fobi/templates/fobi/generic/snippets/form_wizard_ajax.html
  • src/fobi/templates/fobi/generic/snippets/form_wizard_properties_snippet.html
  • src/fobi/templates/fobi/generic/snippets/form_wizard_snippet.html
  • src/fobi/templates/fobi/generic/snippets/form_wizard_view_ajax.html
  • src/fobi/templates/fobi/generic/view_form_wizard_entry.html
  • src/fobi/templates/fobi/generic/view_form_wizard_entry_ajax.html
Existing files
  • src/fobi/contrib/plugins/form_importers/mailchimp_importer/templates/mailchimp_importer/1.html
  • src/fobi/contrib/plugins/form_importers/mailchimp_importer/views.py
  • src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/edit_form_entry_ajax.html
  • src/fobi/contrib/themes/foundation5/templates/foundation5/edit_form_entry_ajax.html
  • src/fobi/templates/fobi/generic/edit_form_entry_ajax.html
Additional listings
Listing 0.8.a “tab-form-elemenets” -> “tab-form-elements”
  • src/fobi/contrib/themes/djangocms_admin_style_theme/static/djangocms_admin_style_theme/css/fobi.djangocms_admin_style_theme.edit.css
  • src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/edit_form_entry_ajax.html
  • src/fobi/contrib/themes/foundation5/templates/foundation5/edit_form_entry_ajax.html
  • src/fobi/contrib/themes/simple/static/simple/css/fobi.simple.edit.css
  • src/fobi/contrib/themes/simple/templates/simple/edit_form_entry_ajax.html
  • src/fobi/templates/fobi/generic/edit_form_entry_ajax.html
  • src/fobi/templates/fobi/generic/edit_form_wizard_entry_ajax.html
Listing 0.8.b form_view_form_entry_option_class property
  • src/fobi/contrib/themes/bootstrap3/fobi_themes.py
  • src/fobi/contrib/themes/djangocms_admin_style_theme/fobi_themes.py
  • src/fobi/contrib/themes/foundation5/fobi_themes.py
  • src/fobi/contrib/themes/simple/fobi_themes.py
  • src/fobi/templates/fobi/generic/edit_form_wizard_entry_ajax.html

0.7.1

2016-09-22

Release sponsored by Goldmund, Wyldebeast & Wunderliebe.

  • Code comply with pep8.
  • Minor fixes in selenium tests.

0.7

2016-09-13

Release sponsored by Goldmund, Wyldebeast & Wunderliebe.

  • Initial Django 1.10 support.
  • django-localeurl has been replaced with i18n_patterns in sample project.
  • Minor fixes.

0.6.10

2016-09-11

  • Moved plugin_uid field choices from model level to form level for FormHandler and FormHandlerEntry models. #37

0.6.9

2016-09-08

  • Moved plugin_uid field choices from model level to form level for FormElement and FormElementEntry models. #37
  • Fixed element “name” field stripping underscores issue. #33

0.6.8

2016-09-06

  • Fixed changing order of the FormElement, FormElementEntry, FormHandler and FormHandlerEntry models.

0.6.7

2016-08-30

  • Minor fixes in db_store plugin (Django 1.6 compatibility issue).
  • Added __str__ methods to models.
  • Restrict queryset to form element entries related to the form entry in position calculation.

0.6.6

2016-05-12

  • Fixed broken dependencies in demos.
  • Minor fixes.
  • Adding a new Select multiple with max plugin, which restricts max number of choices allowed to be chosen.

0.6.5

2015-12-24

  • Minor fixes.

0.6.4

2015-12-24

  • Minor fixes.

0.6.3

2015-12-23

  • Minor fixes.

0.6.2

2015-12-22

  • Make it possible to render a list of forms using custom template tag (not only on the dashboard page).

0.6.1

2015-12-21

  • Documentation fixes.

0.6

2015-12-18

  • Form importers (and as a part of it - MailChimp integration, which would allow to import forms from MailChimp into django-fobi using a user-friendly wizard).
  • Improved Django 1.9 support.

0.5.19

2015-12-15

  • New style urls everywhere.

0.5.18

2015-12-08

  • Minor improvements. Adding request to the get_form_field_instances method of the FormElementPlugin.

0.5.17

2015-10-22

  • Increased easy-thumbnails requirement to >= 2.1 for Python 3, since it was causing installation errors.
  • Increased the django-nine requirement to >=0.1.6, since it has better Python 3 support.

0.5.16

2015-10-05

  • Fixes in migrations on Django 1.7.

0.5.15

2015-09-17

  • Minor fixes.

0.5.14

2015-09-13

  • Add create/update dates to the forms. Adding initial migrations.

0.5.13

2015-09-01

  • Translation fixes.
  • Updating Dutch and Russian translations.

0.5.12

2015-08-29

  • Export/import forms into/from JSON.
  • Minor UI improvements. Adding “Service” tab in the edit view which contains links to export form to JSON and delete form.

Although this release does not contain backwards incompatible changes, there have been several changes in GUI and some parts of the generic HTML and themes were updated. If you have custom themes implemented, you should likely make some minor updates to the HTML in order to reflect the latest GUI changes. The following templates have been affected:

New files
  • src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/import_form_entry.html
  • src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/import_form_entry_ajax.html
  • src/fobi/contrib/themes/foundation5/templates/foundation5/import_form_entry.html
  • src/fobi/contrib/themes/foundation5/templates/foundation5/import_form_entry_ajax.html
  • src/fobi/contrib/themes/simple/templates/simple/import_form_entry.html
  • src/fobi/contrib/themes/simple/templates/simple/import_form_entry_ajax.html
  • src/fobi/templates/fobi/generic/import_form_entry.html
  • src/fobi/templates/fobi/generic/import_form_entry_ajax.html
Existing files
  • src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/dashboard.html
  • src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/edit_form_entry_ajax.html
  • src/fobi/contrib/themes/foundation5/templates/foundation5/dashboard.html
  • src/fobi/contrib/themes/foundation5/templates/foundation5/edit_form_entry_ajax.html
  • src/fobi/contrib/themes/simple/templates/simple/dashboard.html
  • src/fobi/contrib/themes/simple/templates/simple/edit_form_entry_ajax.html
  • src/fobi/templates/fobi/generic/dashboard.html
  • src/fobi/templates/fobi/generic/edit_form_entry_ajax.html

0.5.11

2015-08-20

  • Minor improvements of the dynamic values feature. Forbid usage of django template tags in initial values.

0.5.10

2015-08-18

  • Minor improvements of the initial dynamic values feature.

0.5.9

2015-08-17

  • Minor fixes in the initial dynamic values feature.

0.5.8

2015-08-16

  • Made it possible to define dynamic initials for form fields. Example initial dynamic values in the form (like {{ request.path }}).
  • Minor fixes/improvements.

0.5.7

2015-08-03

  • Minor Python 3 improvements.

0.5.6

2015-07-31

  • django-mptt support through select_mptt_model_object and select_multiple_mptt_model_objects plugins.
  • Python 3 fixes.

0.5.5

2015-06-30

  • Change the action field of the FormEntry into a URL field; check if action exists.
  • captcha, recaptcha and honeypot plugins have been made required in the form.
  • Fix: take default values provided in the plugin_data_fields of the plugin form into consideration.

0.5.4

2015-05-21

  • Minor Django 1.8 fixes.
  • Improved texts/translations.

0.5.3

2015-05-02

  • Minor fixes in the mail form handler plugin.

0.5.2

2015-04-26

  • Make it possible to provide multiple to email addresses in the mail form handler plugin.
  • DateTime picker widget added for Foundation5 theme for date and datetime plugins.
  • Added more tests (more plugins tested).

0.5.1

2015-04-21

  • DateTime picker widget added for Bootstrap 3 theme for date and datetime plugins.

0.5

2015-04-06

Note, that this release contains minor backwards incompatible changes. The changes may affect your existing forms and data. Read the notes below carefully.

  • Fixed previously wrongly labeled (in AppConf) add-ons/plugins (fobi.contrib.plugins.form_handlers.db_store, fobi.contrib.apps.feincms_integration, fobi.contrib.apps.djangocms_integration, fobi.contrib.apps.mezzanine_integration). Due to the change, you would likely have to to rename a couple of database tables and update referencies accordingly. No migrations to solve the issue are included at the moment.

0.4.36

2015-04-03

  • Handle non-ASCII characters content_text form element.

0.4.35

2015-03-28

  • Fixed the issue with allow_multiple working incorrectly for form handler plugins. Fix the db_store plugin as well.

0.4.34

2015-03-27

  • Minor fixes in the Checkbox select multiple and Radio plugins.
  • Minified tox tests.

0.4.33

2015-03-26

  • Checkbox select multiple field added.
  • Minor improvements (styling) in the Foundation 5 theme.
  • Initial configuration for tox tests.
  • Clean up requirements (for example setups and tests).

0.4.32

2015-03-25

  • Updated missing parts in the Russian translations.
  • Minor API improvements. From now on, the run method of form handlers may return a tuple (bool, mixed). In case of errors it might be (False, err).
  • Minor code clean ups.

0.4.31

2015-03-23

  • When path of the uploaded file (plugins) doesn’t yet exist, create it, instaid of failing.

0.4.30

2015-03-23

  • From now on submitted files are sent as attachments in the mail plugin.
  • Documentation improvements. Adding information of rendering forms using django-crispy-forms or alternatives.
  • Minor fixes.

0.4.29

2015-03-20

  • Decimal field added.
  • Float field added.
  • Slug field added.
  • IP address field added.
  • Null boolean field added.
  • Time field added.
  • From now on using simplejson package in favour of json, since it can handle decimal data.
  • Minor improvements of the date plugins (datetime, date).

0.4.28

2015-03-13

  • Fix improperly picked configurations of the fobi.contrib.plugins.form_elements.fields.select_multiple_model_objects plugin.

  • Long identifiers of models can now be safely used in foreign key plugins (such as fobi.contrib.plugins.form_elements.fields.select_model_object_plugin and fobi.contrib.plugins.form_elements.fields.select_multiple_model_objects plugins).

  • Fixed admin bulk change of the plugins.

  • From now it’s possible to have some control/configure the following plugins for the submitted value:

    • fobi.contrib.plugins.form_elements.fields.select_model_object
    • fobi.contrib.plugins.form_elements.fields.select_multiple_model_objects

    The only thing needs to be done is to specify the appropriate variable in the settings module of the project (settings.py).

    • FOBI_FORM_ELEMENT_SELECT_MODEL_OBJECT_SUBMIT_VALUE_AS
    • FOBI_FORM_ELEMENT_SELECT_MULTIPLE_MODEL_OBJECTS_SUBMIT_VALUE_AS

    Allowed values are: “val”, “repr”, “mix”.

0.4.27

2015-03-12

  • Temporary allow the fobi.contrib.plugins.form_handlers.db_store plugin to be used multiple times per form, until the bug with not being able to assign the db_store plugin to the form due to incorrect handling of restrictions (allow_multiple) introduced in previous version is properly fixed.

  • From now it’s possible to have some control/configure the following plugins for the submitted value:

    • fobi.contrib.plugins.form_elements.fields.radio
    • fobi.contrib.plugins.form_elements.fields.select
    • fobi.contrib.plugins.form_elements.fields.select_multiple

    The only thing needs to be done is to specify the appropriate variable in the settings module of the project (settings.py).

    • FOBI_FORM_ELEMENT_RADIO_SUBMIT_VALUE_AS
    • FOBI_FORM_ELEMENT_SELECT_SUBMIT_VALUE_AS
    • FOBI_FORM_ELEMENT_SELECT_MULTIPLE_SUBMIT_VALUE_AS

    Allowed values are: “val”, “repr”, “mix”.

0.4.26

2015-03-06

  • Validate fobi.contrib.plugins.form_elements.fields.email, fobi.contrib.plugins.form_elements.fields.integer and fobi.contrib.plugins.form_elements.fields.url plugins initial values.
  • Properly show field types “checkbox” and “radio” in the input plugin (as previously they showed up too large).
  • It’s now possible to restrict multiple usage of form handler plugins via allow_multiple property. In case if it’s set to False, the plugin can be used once only (per form). Default value is True. The db_store plugin is from now on allowed to be used only once (per form).

0.4.25

2015-03-04

  • Post-fix in the discover module (moved logging definition up).

0.4.24

2015-03-04

  • The management command migrate_03_to_04 intended to migrate 0.3.x branch data to > 0.4.x branch data, has been renamed to fobi_migrate_03_to_04.
  • Add missing app config declaration for the db_store form handler plugin.
  • Add missing app config for the core fobi package.
  • Improved autodiscover for Django>=1.7. Fix exception when using a dotted path to an AppConfig in INSTALLED_APPS (instead of using the path to the app: ex. “path.to.app.apps.AppConfig” instead of “path.to.app”).

0.4.23

2015-03-04

  • Fix improper initial value validation for Select-like (radio, select and select_multiple) plugins.

0.4.22

2015-03-03

  • Fix replace system-specific path separator by a slash on file urls.
  • Fix empty options appearing in the Select-like (radio, select and select_multiple) plugins and unified the processing of the raw choices data.
  • Validate the initial value for Select-like (radio, select and select_multiple) plugins.

0.4.21

2015-02-28

  • The fobi.contrib.plugins.form_elements.fields.select_multiple_model_objects plugin added.

0.4.20

2015-02-27

  • Make it possible to load initial form data from GET variables.
  • Remove “button” and “submit” types from fobi.contrib.elements.fields.input form element plugin.
  • The fobi.contrib.plugins.form_elements.fields.select_model_object plugin no longer returns an absolute URL to the admin of the chosen model object instance. Instead, it contains the app label, model name, pk and the repr of it separated by dots. Example: “comments.comment.5.Lorem ipsum”.
  • Minor fixes in from fobi.contrib.elements.fields.file plugin. Use system path separator on from fobi.contrib.elements.fields.file.FILES_UPLOAD_DIR default setting.
  • Minor documentation improvements.

0.4.19

2015-02-15

  • Some more work on future (Django 1.9) compatibility.
  • Replace bits of backwards-/forwards- compatibility code with equal code parts of django-nine.

0.4.18

2015-02-13

  • From now on it’s possible to localise (translated) URLs.
  • Safe way to get the user model for Django >= 1.5.* <= 1.8.*

0.4.17

2015-02-12

  • Fix circular imports by proper referencing of the user model in foreign key and many-to-many relations (settings.AUTH_USER_MODEL instead of django.contrib.auth.get_user_model).
  • Minor documentation improvements.

0.4.16

2015-02-10

  • A new theme djangocms_admin_style_theme added.
  • Making fobi.fields.NoneField always valid.
  • Initial work on Django 1.8 and 1.9 support.
  • Minor fixes.

0.4.15

2015-01-27

  • Fix the “large” checkboxes in edit mode - now shown small as they should be.

0.4.14

2015-01-26

  • German translations added.

0.4.13

2015-01-15

  • Remove an ipdb statement from base integration processor fobi.integration.processors.IntegrationProcessor.
  • Added information in the docs about FeinCMS demo part on heroku demo.
  • Make sure values of form elements declared not to have a value (has_value property is set to False) aren’t being saved in the db_store plugin.
  • Remove redundant static assets (package size decreased).

0.4.12

2015-01-14

  • Fix empty options appearing in the Select-like plugins and unified the processing of the raw choices data.
  • Update the vishap package requirement to latest stable 0.1.3.
  • Support for wheel packages.

0.4.11

2014-12-29

  • Styling fixes in the radio button field of the bootstrap3 theme.
  • Fixed db_store issue with CSV/XLS export failing on Django 1.7.

0.4.10

2014-12-28

  • Minor fixes in FeinCMS integration app.

0.4.9

2014-12-28

  • Third party app integration (at the moment, FeinCMS, DjangoCMS, Mezzanine) had been generalised and unified.
  • Mention the Heroku live demo in the docs.
  • Minor CSS fixes in the simple theme.

0.4.8

2014-12-25

  • More verbose debugging.

0.4.7

2014-12-24

  • Temporary left out the “cloneable” column from the dashboard templates.
  • Fixed broken imports in CAPTCHA plugin.
  • Fixed broken imports in ReCAPTCHA plugin.

0.4.6

2014-12-23

  • Updated requirements for the vishap package to avoid the six version conflicts.
  • Minor documentation fixes.

0.4.5

2014-12-17

  • ReCAPTCHA field added.
  • Mezzanine integration app added.
  • Remove redundant dependencies (django-tinymce).
  • Minor improvements of the discover module.

0.4.4

2014-12-06

  • Documentation improvements.
  • Updated Dutch and Russian translations.
  • Minor fixes related to lazy translations.

0.4.3

2014-12-05

  • Make sure values of form elements declared not to have a value (has_value property is set to False) aren’t being saved in the db_store plugin.
  • Apply that to the honeypot and captcha plugins.

0.4.2

2014-12-04

  • Helper script (management command) in order to migrate django-fobi==0.3.* data to django-fobi==0.4.* data (caused by renaming the birthday field to date_drop_down - see the release notes of 0.4 below). Follow the steps precisely in order to painlessly upgrade your django-fobi==0.3.* to django-fobi==0.4.*:

    1. Install django-fobi>=0.4.2:

      pip install django-fobi>=0.4.2
      
    2. In your settings change the:

      'fobi.contrib.plugins.form_elements.fields.birthday'
      

      to:

      'fobi.contrib.plugins.form_elements.fields.date_drop_down'
      
    3. Run the migrate_03_to_04 management command. Note, that as of version 0.4.24, the migrate_03_to_04 command has been renamed to fobi_migrate_03_to_04.:

      ./manage.py migrate_03_to_04
      

0.4.1

2014-12-04

  • Fixes in Foundation5 and Simple themes related to the changes in error validation/handling of hidden fields.

0.4

2014-12-03

Note, that this release contains minor backwards incompatible changes. The changes may affect your existing forms and data. Read the notes below carefully (UPDATE 2014-12-04: the django-fobi==0.4.2 contains a management command which makes the necessary changes in the database for safe upgrade).

  • The captcha field has been moved from fobi.contrib.plugins.form_elements.fields.captcha to fobi.contrib.plugins.form_elements.security.captcha. Make sure to update the package paths in INSTALLED_APPS of your projects’ settings module (settings.py) when upgrading to this version.
  • The honeypot field has been added.
  • The birthday field has been renamed to date_drop_down (A real birthday field is still to come in later releases). The change causes backwards incompatibility issues if you have used that birthday field. If you haven’t - you have nothing to worry. If you have been using it, grab the 0.3.4 version, copy the fobi.contrib.plugins.form_elements.fields.date_drop_down package to your project apps, make necessary path changes and update the package paths in INSTALLED_APPS settings module (settings.py) before upgrading to this version. Then, in Django admin management interface, replace all the occurances of Birthday field with Date drop down field.
  • Better error validation/handling of hidden fields. A new form snippet template added for displaying the non-field and hidden fields errors. The new template makes a part of a standard theme as an attribute form_non_field_and_hidden_errors_snippet_template.
  • Minor fixes in generic templates.
  • An additional property is_hidden added to the hidden form elements. Those form elements would be getting a default TextInput widget in the edit mode instead of the widget they come from by default. It’s possible to provide an alternative widget for the edit mode as well. Default value of the is_hidden is set to False.

0.3.4

2014-11-23

  • New settings FOBI_FAIL_ON_ERRORS_IN_FORM_ELEMENT_PLUGINS and FOBI_FAIL_ON_ERRORS_IN_FORM_HANDLER_PLUGINS introduced. They do as their name tells. Default value for both is False.
  • Fixed exceptions raised when unicode characters were used as form names.
  • Fixed exceptions raised when unicode characters were used as field labels.
  • Fixes in the db_store and mail plugins related to usage of unicode characters.

0.3.3

2014-11-22

  • Clean up the setup. Remove redundant dependencies.
  • Documentation improvements.

0.3.2

2014-11-20

  • DjangoCMS integration app made compatible with DjangoCMS 2.4.3.

0.3.1

2014-11-19

  • DjangoCMS integration app.

0.3

2014-11-09

Note, that this release contains minor backwards incompatible changes. The changes do not anyhow affect your existing forms or data. The only thing you need to do is update the app paths in the settings module of your project.

  • Minor core improvements related to the themeing of the form handler plugins.
  • Several presentational form element plugins have been renamed. The fobi.contrib.plugins.form_elements.content.image plugin has been renamed to fobi.contrib.plugins.form_elements.content.content_image. The fobi.contrib.plugins.form_elements.content.text plugin has been renamed to fobi.contrib.plugins.form_elements.content.content_text. The fobi.contrib.plugins.form_elements.content.video plugin has been renamed to fobi.contrib.plugins.form_elements.content.content_video. If you have used any of the above mentioned plugins, make sure to update the app paths in the settings module of your project.
  • The fobi.contrib.plugins.form_elements.content.dummy plugin has been moved to fobi.contrib.plugins.form_elements.test.dummy location. If you have used it, make sure to update the its’ path in the settings module of your project.
  • Added readme to the following content form element plugins: dummy, content_image, content_text and content_video.
  • Added foundation5 and simple theme widgets for db_store plugin.
  • If you have been overriding the defaults of the db_store plugin, change the prefix from FOBI_PLUGIN_DB_EXPORT_ to FOBI_PLUGIN_DB_STORE_. For example, FOBI_PLUGIN_DB_EXPORT_CSV_DELIMITER should become FOBI_PLUGIN_DB_STORE_CSV_DELIMITER.
  • Mentioning the fobi_find_broken_entries management command in the documentation, as well as improving the management command itself (more verbose output).
  • Birthday field added.

0.2.1

2014-11-06

  • Minor improvements of the db_store plugin.
  • Minor improvements of the simple theme. Make sure that custom form handler actions are properly shown in the form handlers list.
  • Make it possible to fail silently on missing form element or form handler plugins by setting the respected values to False: FOBI_FAIL_ON_MISSING_FORM_ELEMENT_PLUGINS, FOBI_FAIL_ON_MISSING_FORM_HANDLER_PLUGINS. Otherwise an appropriate exception is raised.

0.2

2014-11-05

Note, that this release contains minor backwards incompatible changes.

  • Minor (backwards incompatible) changes in the form handler plugin API. From now on both custom_actions and get_custom_actions methods accept form_entry (obligatory) and request (optional) arguments. If you have written your own or have changed existing form handler plugins with use of one of the above mentioned methods, append those arguments to the method declarations when upgrading to this version. If you haven’t written your own or changed existing form handler plugins, you may just upgrade to this version.
  • Added data export features to the db_store plugin.
  • Minor fixes in db_store plugin.
  • Added missing documentation for the feincms_integration app.
  • Updated translations for Dutch and Russian.

0.1.6

2014-10-25

  • Minor improvements in the theming API. From now on the view_embed_form_entry_ajax_template template would be used when integrating the form rendering from other products (for example, a CMS page, which has a widget which references the form object. If that property is left empty, the view_form_entry_ajax_template is used. For a success page the embed_form_entry_submitted_ajax_template template would be used.
  • Functional improvements of the FeinCMS integration (the widget). If you have used the FeinCMS widget of earlier versions, you likely want to update to this one. From now on you can select a custom form title and the button text, as well as provide custom success page title and the success message; additionally, it has been made possible to hide the form- or success-page- titles.

0.1.5

2014-10-23

  • Minor fixes in the Integer form element plugin.
  • Minor fixes in the Input form element plugin.
  • Minor fixes in themes (disable HTML5 form validation in edit mode).
  • Minor documentation improvements.

0.1.4

2014-10-22

  • Minor core improvements.
  • Django 1.5 support improvements.
  • Django 1.7 support improvements.
  • Added Captcha form element plugin.
  • Added highly-customisable Input form element plugin - a custom input field with support for almost any ever existing HTML attribute.
  • Documentation improvements.

0.1.3

2014-10-13

  • Django 1.7 support.
  • Add HTML5 “placeholder” field attribute support.

0.1.2

2014-10-11

  • Simple theme fixes: Fix for making the theme work in Django 1.5.

0.1.1

2014-10-11

  • Bootstrap 3 theme fixes: When tab pane has no or little content so that the height of the dropdown menu exceeds the height of the tab pane content the dropdown menu now becomes scrollable (vertically).

0.1

2014-10-11

  • Initial release.

Licenses

Below information about third-party packages used in the project is presented.

Bootstrap3

http://getbootstrap.com/

Licensing information:

Pillow

http://python-pillow.github.io/

Licensing information:

Indices and tables

(Sub)modules

Some additional documentation on django-fobi sub-modules are listed below.

fobi.contrib.apps.djangocms_integration

A django-fobi integration with DjangoCMS.

Prerequisites

Tested with DjangoCMS 2.4.3, 3.0.6 and 3.4.3 only. Might work on earlier (or later) versions as well.

Installation

your_project/settings.py

See the example settings files:

INSTALLED_APPS = list(INSTALLED_APPS)
INSTALLED_APPS += [
    'cms',  # DjangoCMS

    'fobi.contrib.apps.djangocms_integration',  # Fobi DjangoCMS app
]

Information for developers

Templates for DjangoCMS

Django-CMS templates are quite specific and in some aspects are not 100% compatible with built-in themes (due to the fact that DjangoCMS intensively makes use of django-sekizai which isn’t used in the generic templates).

That does not anyhow affect the core fobi and the built-in themes, although you can’t magically reuse built-in fobi themes with Django-CMS (as it’s done for FeinCMS page templates).

You would have to make custom page templates from scratch (or based on a copy of the desired bundled template). See how I did it for all bundled themes here:

Template rendering

The embed DjangoCMS widget is rendered with use of two theme templates:

  • view_embed_form_entry_ajax_template: Used for rendering the form.
  • embed_form_entry_submitted_ajax_template: Used for rendering the form sent event.
Using custom templates for rendering the widget

In the widget, you can specify a template which you want to be used for rendering the form or the form-sent event.

Example:

FOBI_DJANGOCMS_INTEGRATION_FORM_TEMPLATE_CHOICES = (
    ("yourapp/custom_view_embed_form_v1.html",
     "Custom embed form view template #1"),
    ("yourapp/custom_view_embed_form_v2.html",
     "Custom embed form view template #2"),
)

Same goes for form-sent templates.

FOBI_DJANGOCMS_INTEGRATION_SUCCESS_PAGE_TEMPLATE_CHOICES = (
    ("yourapp/custom_embed_form_submitted_v1.html",
     "Custom form-sent template #1"),
    ("yourapp/custom_embed_form_submitted_v2.html",
     "Custom form-sent template #2"),
)

Registering a template in the FORM_TEMPLATE_CHOICES makes it available for all the themes. If you rather want to use different custom templates for different themes, use the FOBI_CUSTOM_THEME_DATA as shown in the example below.

FOBI_CUSTOM_THEME_DATA = {
    'bootstrap3': {
        'djangocms_integration': {
            'form_template_choices': [
                ('fobi/bootstrap3_extras/view_embed_form.html',
                 "Custom bootstrap3 embed form view template"),
            ],
            'success_page_template_choices': [
                ('fobi/bootstrap3_extras/embed_form_submitted.html',
                 "Custom bootstrap3 embed form entry submitted template"),
            ],
        },
    },
    'foundation5': {
        'djangocms_integration': {
            'form_template_choices': [
                ('fobi/foundation5_extras/view_embed_form.html',
                 "Custom foundation5 embed form view template"),
            ],
            'success_page_template_choices': [
                ('fobi/foundation5_extras/embed_form_submitted.html',
                 "Custom foundation5 embed form entry submitted template"),
            ],
        },
    },
}

Usage

The fobi.contrib.apps.djangocms_integration.models.FobiFormWidget consists of the following fields:

  • Form: The form to be used.
  • Form template name: Template to be used to render the embed form.
  • Hide form title: If checked, no form title would be shown.
  • Form title: Overrides the standard form title.
  • Submit button text: Overrides the default submit button text.
  • Success page template name: Template to be used to render the embed form-sent event.
  • Hide success page title: If checked, no form-sent title would be shown.
  • Success page title: Overrides the form-sent title.
  • Success page text: Overrides the form-sent text.

fobi.contrib.apps.drf_integration

A django-fobi integration with Django REST framework.

Supported actions are:

  • LIST: List all the forms.
  • OPTIONS: Describe the given form.
  • PUT: Submit form data.

Live demo

Live demo is available on Heroku.

Supported fields

The following fields are supported.

Content (presentational form elements)

Unlike standard fields, content fields are purely presentational. You’re not supposed to make write actions on them (it won’t work). Neither will they be displayed in the browsable API (list/retrieve actions). However, they will be listed in the options action call. All content fields are of type “content”.

  • content_image
  • content_image_url
  • content_text
  • content_video
Fields
  • boolean
  • checkbox_select_multiple
  • date
  • date_drop_down
  • datetime
  • decimal
  • email
  • file
  • float
  • hidden (in terms of the Django REST framework - a read-only field)
  • input (some sort of a copy of text plugin)
  • integer
  • ip_address
  • null_boolean
  • password (some sort of a copy of text plugin)
  • radio
  • range_select
  • regex
  • select
  • select_multiple
  • select_multiple_with_max
  • slider (just a copy of range_select, for compatibility with main package)
  • slug
  • text
  • textarea (some sort of a copy of text plugin)
  • time
  • url

Not (yet) supported fields

The following fields are not supported. Those marked with asterisk are planned to be supported in the upcoming releases.

  • select_model_object
  • select_mptt_model_object
  • select_multiple_model_objects
  • select_multiple_mptt_model_objects

Implementation details

Each django-fobi plugin has its’ own representative integration plugin within fobi.contrib.aps.drf_integration package.

Some of the plugins may seam to have zero-added-value and in fact they are. For instance, DRF integration slider plugin is just an exact copy of the range_select plugin, created in order to provide exactly the same form fields generated in the API.

You should mention all the plugins you want to use explicitly in the project settings. Thus, if you have used (included in the INSTALLED_APPS) the core plugins:

  • fobi.contrib.plugins.form_elements.fields.boolean
  • fobi.contrib.plugins.form_elements.fields.checkbox_select_multiple
  • fobi.contrib.plugins.form_elements.fields.date
  • fobi.contrib.plugins.form_elements.fields.date_drop_down
  • fobi.contrib.plugins.form_elements.fields.datetime
  • fobi.contrib.plugins.form_elements.fields.decimal
  • fobi.contrib.plugins.form_elements.fields.email
  • fobi.contrib.plugins.form_elements.fields.file
  • fobi.contrib.plugins.form_elements.fields.float
  • fobi.contrib.plugins.form_elements.fields.hidden
  • fobi.contrib.plugins.form_elements.fields.input
  • fobi.contrib.plugins.form_elements.fields.integer
  • fobi.contrib.plugins.form_elements.fields.ip_address
  • fobi.contrib.plugins.form_elements.fields.null_boolean
  • fobi.contrib.plugins.form_elements.fields.password
  • fobi.contrib.plugins.form_elements.fields.radio
  • fobi.contrib.plugins.form_elements.fields.range_select
  • fobi.contrib.plugins.form_elements.fields.regex
  • fobi.contrib.plugins.form_elements.fields.select
  • fobi.contrib.plugins.form_elements.fields.select_multiple
  • fobi.contrib.plugins.form_elements.fields.select_multiple_with_max
  • fobi.contrib.plugins.form_elements.fields.slider
  • fobi.contrib.plugins.form_elements.fields.slug
  • fobi.contrib.plugins.form_elements.fields.text
  • fobi.contrib.plugins.form_elements.fields.textarea
  • fobi.contrib.plugins.form_elements.fields.time
  • fobi.contrib.plugins.form_elements.fields.url
  • fobi.contrib.plugins.form_elements.content.content_image
  • fobi.contrib.plugins.form_elements.content.content_image_url
  • fobi.contrib.plugins.form_elements.content.content_text
  • fobi.contrib.plugins.form_elements.content.content_video
  • fobi.contrib.plugins.form_handlers.db_store
  • fobi.contrib.plugins.form_handlers.http_repost
  • fobi.contrib.plugins.form_handlers.mail

You should include their correspondent Django REST framework implementations in the INSTALLED_APPS as well:

  • fobi.contrib.apps.drf_integration.form_elements.fields.boolean
  • fobi.contrib.apps.drf_integration.form_elements.fields.checkbox_select_multiple
  • fobi.contrib.apps.drf_integration.form_elements.fields.date
  • fobi.contrib.apps.drf_integration.form_elements.fields.date_drop_down
  • fobi.contrib.apps.drf_integration.form_elements.fields.datetime
  • fobi.contrib.apps.drf_integration.form_elements.fields.decimal
  • fobi.contrib.apps.drf_integration.form_elements.fields.email
  • fobi.contrib.apps.drf_integration.form_elements.fields.file
  • fobi.contrib.apps.drf_integration.form_elements.fields.float
  • fobi.contrib.apps.drf_integration.form_elements.fields.hidden
  • fobi.contrib.apps.drf_integration.form_elements.fields.input
  • fobi.contrib.apps.drf_integration.form_elements.fields.integer
  • fobi.contrib.apps.drf_integration.form_elements.fields.ip_address
  • fobi.contrib.apps.drf_integration.form_elements.fields.null_boolean
  • fobi.contrib.apps.drf_integration.form_elements.fields.password
  • fobi.contrib.apps.drf_integration.form_elements.fields.radio
  • fobi.contrib.apps.drf_integration.form_elements.fields.range_select
  • fobi.contrib.apps.drf_integration.form_elements.fields.regex
  • fobi.contrib.apps.drf_integration.form_elements.fields.select
  • fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple
  • fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple_with_max
  • fobi.contrib.apps.drf_integration.form_elements.fields.slider
  • fobi.contrib.apps.drf_integration.form_elements.fields.slug
  • fobi.contrib.apps.drf_integration.form_elements.fields.text
  • fobi.contrib.apps.drf_integration.form_elements.fields.textarea
  • fobi.contrib.apps.drf_integration.form_elements.fields.time
  • fobi.contrib.apps.drf_integration.form_elements.fields.url
  • fobi.contrib.apps.drf_integration.form_elements.content.content_image
  • fobi.contrib.apps.drf_integration.form_elements.content.content_image_url
  • fobi.contrib.apps.drf_integration.form_elements.content.content_text
  • fobi.contrib.apps.drf_integration.form_elements.content.content_video
  • fobi.contrib.apps.drf_integration.form_handlers.db_store
  • fobi.contrib.apps.drf_integration.form_handlers.http_repost
  • fobi.contrib.apps.drf_integration.form_handlers.mail

Installation

Versions

Was made with djangorestframework 3.6.2. May work on earlier versions, although not guaranteed.

See the requirements file.

your_project/settings.py

See the example settings file.

INSTALLED_APPS = list(INSTALLED_APPS)
INSTALLED_APPS += [
    # ...
    # Here should come a list of form element plugins of the core
    # package, followed by the list of form handler plugins of the core
    # package, followed by the list of themes of the core package and
    # all other apps that do matter.
    # ...
    'rest_framework',  # Django REST framework
    'fobi.contrib.apps.drf_integration',  # DRF integration app

    # DRF integration form element plugins - fields
    'fobi.contrib.apps.drf_integration.form_elements.fields.boolean',
    'fobi.contrib.apps.drf_integration.form_elements.fields.checkbox_select_multiple',
    'fobi.contrib.apps.drf_integration.form_elements.fields.date',
    'fobi.contrib.apps.drf_integration.form_elements.fields.datetime',
    'fobi.contrib.apps.drf_integration.form_elements.fields.decimal',
    'fobi.contrib.apps.drf_integration.form_elements.fields.email',
    'fobi.contrib.apps.drf_integration.form_elements.fields.file',
    'fobi.contrib.apps.drf_integration.form_elements.fields.float',
    'fobi.contrib.apps.drf_integration.form_elements.fields.hidden',
    'fobi.contrib.apps.drf_integration.form_elements.fields.input',
    'fobi.contrib.apps.drf_integration.form_elements.fields.integer',
    'fobi.contrib.apps.drf_integration.form_elements.fields.ip_address',
    'fobi.contrib.apps.drf_integration.form_elements.fields.null_boolean',
    'fobi.contrib.apps.drf_integration.form_elements.fields.password',
    'fobi.contrib.apps.drf_integration.form_elements.fields.radio',
    'fobi.contrib.apps.drf_integration.form_elements.fields.range_select',
    'fobi.contrib.apps.drf_integration.form_elements.fields.regex',
    'fobi.contrib.apps.drf_integration.form_elements.fields.select',
    'fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple',
    'fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple_with_max',
    'fobi.contrib.apps.drf_integration.form_elements.fields.slider',
    'fobi.contrib.apps.drf_integration.form_elements.fields.slug',
    'fobi.contrib.apps.drf_integration.form_elements.fields.text',
    'fobi.contrib.apps.drf_integration.form_elements.fields.textarea',
    'fobi.contrib.apps.drf_integration.form_elements.fields.time',
    'fobi.contrib.apps.drf_integration.form_elements.fields.url',

    # DRF integration form element plugins - presentational
    'fobi.contrib.apps.drf_integration.form_elements.content.content_image',
    'fobi.contrib.apps.drf_integration.form_elements.content.content_image_url',
    'fobi.contrib.apps.drf_integration.form_elements.content.content_text',
    'fobi.contrib.apps.drf_integration.form_elements.content.content_video',

    # DRF integration form handler plugins
    'fobi.contrib.apps.drf_integration.form_handlers.db_store',
    'fobi.contrib.apps.drf_integration.form_handlers.mail',
    'fobi.contrib.apps.drf_integration.form_handlers.http_repost',
    # ...
]
your_project/urls.py

Add the following code to the main urls.py of your project:

# Conditionally including django-rest-framework integration app
if 'fobi.contrib.apps.drf_integration' in settings.INSTALLED_APPS:
    from fobi.contrib.apps.drf_integration.urls import fobi_router
    urlpatterns += [
        url(r'^api/', include(fobi_router.urls))
    ]

Usage

If you have followed the steps above precisely, you would be able to access the API using http://localhost:8000/api/fobi-form-entry/.

Actions/methods supported:

LIST
GET /api/fobi-form-entry/

Lists all the forms available. Anonymous users would see the list of all public forms. Authenticated users would see their own forms in addition to the public forms.

OPTIONS
OPTIONS /api/fobi-form-entry/{FORM_SLUG}/

Lists all field options for the selected form.

See the test DRF form and same form in DRF integration app with most of the fields that do have rich additional metadata.

OPTIONS call produces the following response:

OPTIONS /api/fobi-form-entry/test-drf-form/
HTTP 200 OK
Allow: GET, PUT, PATCH, OPTIONS
Content-Type: application/json
Vary: Accept
{
    "name": "Fobi Form Entry Instance",
    "description": "FormEntry view set.",
    "renders": [
        "application/json",
        "text/html"
    ],
    "parses": [
        "application/json",
        "application/x-www-form-urlencoded",
        "multipart/form-data"
    ],
    "actions": {
        "PUT": {
            "test_integer": {
                "type": "integer",
                "required": false,
                "read_only": false,
                "label": "Test integer",
                "min_value": 1,
                "max_value": 20,
                "initial": 10
            },
            "test_email": {
                "type": "email",
                "required": true,
                "read_only": false,
                "label": "Test email",
                "help_text": "Donec mollis hendrerit risus. Phasellus a "
                             "est. Nam ipsum risus, rutrum vitae, "
                             "vestibulum eu, molestie vel, lacus. "
                             "Praesent nec nisl a purus blandit viverra. "
                             "Cras id dui.",
                "max_length": 255,
                "placeholder": "john@doe.com"
            },
            "test_text": {
                "type": "string",
                "required": false,
                "read_only": false,
                "label": "Test text",
                "help_text": "Sed lectus. Phasellus gravida semper "
                             "nisi. Curabitur at lacus ac velit ornare "
                             "lobortis. Mauris turpis nunc, blandit et, "
                             "volutpat molestie, porta ut, ligula. Lorem "
                             "ipsum dolor sit amet, consectetuer "
                             "adipiscing elit.",
                "max_length": 255,
                "placeholder": "Lorem ipsum dolor sit amet"
            },
            "test_url": {
                "type": "url",
                "required": false,
                "read_only": false,
                "label": "Test URL",
                "max_length": 255,
                "initial": "http://github.com"
            },
            "test_decimal_field": {
                "type": "decimal",
                "required": false,
                "read_only": false,
                "label": "Test decimal field",
                "min_value": 1.0,
                "max_value": 25.0,
                "initial": 10.0,
                "placeholder": "3.14",
                "max_digits": 5,
                "decimal_places": 2
            },
            "test_float_field": {
                "type": "float",
                "required": false,
                "read_only": false,
                "label": "Test float field",
                "min_value": 1.0,
                "max_value": 10.0,
                "initial": 3.14
            },
            "test_ip_address": {
                "type": "string",
                "required": false,
                "read_only": false,
                "label": "Test IP address",
                "max_length": 255,
                "placeholder": "127,0.0.1"
            },
            "test_password_field": {
                "type": "string",
                "required": false,
                "read_only": false,
                "label": "Test password field",
                "max_length": 255,
                "placeholder": "your-secret-password"
            },
            "test_regex_field": {
                "type": "regex",
                "required": false,
                "read_only": false,
                "label": "Test regex field",
                "max_length": 255,
                "regex": "^([a-zA-Z])+$"
            },
            "test_slug_field": {
                "type": "slug",
                "required": false,
                "read_only": false,
                "label": "Test slug field",
                "max_length": 255,
                "placeholder": "lorem-ipsum-dolor-sit-amet"
            },
            "test_textarea_field": {
                "type": "string",
                "required": false,
                "read_only": false,
                "label": "Test textarea field",
                "placeholder": "Pellentesque habitant morbi tristique."
            },
            "test_input_field": {
                "type": "string",
                "required": false,
                "read_only": true,
                "label": "Test input field",
                "max_length": 255,
                "autofocus": "autofocus",
                "autocomplete": "on",
                "disabled": "disabled"
            },
            "content_image_url_b0996b16-9f1c-430d-a6c7-0a722f4c2177": {
                "type": "content",
                "required": false,
                "read_only": true,
                "initial": "<p><img src=\"http://example.com/image.jpg\" alt=\"n.n.\" width=\"600\"/></p>",
                "contenttype": "image",
                "raw_data": {
                    "url": "http://example.com/image.jpg",
                    "alt": "n.n.",
                    "fit_method": "fit_width",
                    "size": "600x600"
                },
                "content": "<p><img src=\"http://example.com/image.jpg\" alt=\"n.n.\" width=\"600\"/></p>"
            },
            "content_text_de4d69b2-99e1-479d-8c61-1534dea7c981": {
                "type": "content",
                "required": false,
                "read_only": true,
                "initial": "<p>Pellentesque posuere. Quisque id mi. "
                           "Duis arcu tortor, suscipit eget, imperdiet "
                           "nec, imperdiet iaculis, ipsum. Phasellus a "
                           "est. In turpis.</p>",
                "contenttype": "text",
                "raw_data": {
                    "text": "Pellentesque posuere. Quisque id mi. Duis "
                            "arcu tortor, suscipit eget, imperdiet nec, "
                            "imperdiet iaculis, ipsum. Phasellus a est. "
                            "In turpis."
                },
                "content": "<p>Pellentesque posuere. Quisque id mi. Duis "
                           "arcu tortor, suscipit eget, imperdiet nec, "
                           "imperdiet iaculis, ipsum. Phasellus a est. "
                           "In turpis.</p>"
            },
            "content_video_f4799aca-9a0b-4f1a-8069-dda611858ef4": {
                "type": "content",
                "required": false,
                "read_only": true,
                "initial": "<iframe src=\"//www.youtube.com/embed/8GVIui0JK0M\" width=\"500\" height=\"400\" frameborder=\"0\" allowfullscreen></iframe>",
                "contenttype": "video",
                "raw_data": {
                    "title": "Delusional Insanity - To far beyond...",
                    "url": "https://www.youtube.com/watch?v=8GVIui0JK0M&t=1s",
                    "size": "500x400"
                },
                "content": "<iframe src=\"//www.youtube.com/embed/8GVIui0JK0M\" width=\"500\" height=\"400\" frameborder=\"0\" allowfullscreen></iframe>"
            }
        }
    }
}

Some insights:

Meta-data is passed to the DRFIntegrationFormElementPluginProcessor as field_metadata argument, which is supposed to be a dict.

Private forms would be only visible to authenticated users.

PUT
PUT /api/fobi-form-entry/{FORM_SLUG}/

{DATA}

Callbacks

Callbacks work just the same way the core callbacks work.

fobi_form_callbacks.py
from fobi.base import (
    integration_form_callback_registry,
    IntegrationFormCallback,
)

from fobi.constants import (
    CALLBACK_BEFORE_FORM_VALIDATION,
    CALLBACK_FORM_INVALID,
    CALLBACK_FORM_VALID,
    CALLBACK_FORM_VALID_AFTER_FORM_HANDLERS,
    CALLBACK_FORM_VALID_BEFORE_SUBMIT_PLUGIN_FORM_DATA,
)

from fobi.contrib.apps.drf_integration import UID as INTEGRATE_WITH


class DRFSaveAsFooItem(IntegrationFormCallback):
    """Save the form as a foo item, if certain conditions are met."""

    stage = CALLBACK_FORM_VALID
    integrate_with = INTEGRATE_WITH

    def callback(self, form_entry, request, **kwargs):
        """Custom callback login comes here."""
        logger.debug("Great! Your form is valid!")


class DRFDummyInvalidCallback(IntegrationFormCallback):
    """Saves the form as a foo item, if certain conditions are met."""

    stage = CALLBACK_FORM_INVALID
    integrate_with = INTEGRATE_WITH

    def callback(self, form_entry, request, **kwargs):
        """Custom callback login comes here."""
        logger.debug("Damn! You've made a mistake, boy!")

Testing

To test Django REST framework integration package only, run the following command:

./runtests.py src/fobi/tests/test_drf_integration.py

or use plain Django tests:

./manage.py test fobi.tests.test_drf_integration --settings=settings.test

Limitations

Certain fields are not available yet (relational fields).

Form elements

Content form element

Presentational form elements for drf_integration.

fobi.contrib.apps.drf_integration.form_elements.content.content_image

A django-fobi ContentImage plugin for integration with Django REST framework. Makes use of the fobi.contrib.apps.drf_integration.fields.ContentImage.

Installation
  1. Add fobi.contrib.apps.drf_integration.form_elements.content.content_image to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.apps.drf_integration.form_elements.content.content_image',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

Usage

Unlike standard fields, ContentImage field is purely presentational. You’re not supposed to make write actions on it (it won’t work). Neither will it be displayed in the browsable API (list/retrieve actions). However, it will be listed in the options action call.

Sample JSON response fragment

"actions": {
    "PUT": {
        // ...
        "content_image_89c8c319-195b-487a-a44d-f59ef14a5d44": {
            "type": "content",
            "required": false,
            "read_only": true,
            "contenttype": "image",
            "content": "\n<p>\n\n\n\n\n<img src=\"/media/fobi_plugins/content_image/test-image-thumbnail.jpg\" alt=\"Lorem ipsum\"/>\n\n\n</p>\n",
            "raw": {
                "file": "/media/fobi_plugins/content_image/test-image.jpg",
                "alt": "Lorem ipsum",
                "fit_method": "center",
                "size": "500x500"
            }
        },
        // ...
    }
}

JSON response fragment explained

  • type (str): Set to “content” for all presentational form elements.
  • contenttype (str): Set to “image” for ContentImage field.
  • content (str): Representation of the content. Rendered partial HTML.
  • raw (json dict): Raw attributes of the ContentImage plugin. Contains “file”, “alt”, “fit_method” and “size” attributes.
fobi.contrib.apps.drf_integration.form_elements.content.content_image_url

A django-fobi ContentImageURL plugin for integration with Django REST framework. Makes use of the fobi.contrib.apps.drf_integration.fields.ContentImage.

Installation
  1. Add fobi.contrib.apps.drf_integration.form_elements.content.content_image_url to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.apps.drf_integration.form_elements.content.content_image_url',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

Usage

Unlike standard fields, ContentImageURL field is purely presentational. You’re not supposed to make write actions on it (it won’t work). Neither will it be displayed in the browsable API (list/retrieve actions). However, it will be listed in the options action call.

Sample JSON response fragment

"actions": {
    "PUT": {
        // ...
        "content_image_89c8c319-195b-487a-a44d-f59ef14a5d44": {
            "type": "content",
            "required": false,
            "read_only": true,
            "contenttype": "image",
            "content": "\n<p>\n\n\n\n\n<img src=\"http://example.com/media/test-image.jpg\" alt=\"Lorem ipsum\"/>\n\n\n</p>\n",
            "raw": {
                "url": "http://example.com/media/test-image.jpg",
                "alt": "Lorem ipsum",
                "fit_method": "fit_width",
                "size": "500x500"
            }
        },
        // ...
    }
}

JSON response fragment explained

  • type (str): Set to “content” for all presentational form elements.
  • contenttype (str): Set to “image” for ContentImageURL field.
  • content (str): Representation of the content. Rendered partial HTML.
  • raw (json dict): Raw attributes of the ContentImageURL plugin. Contains “url”, “alt”, “fit_method” and “size” attributes.
fobi.contrib.apps.drf_integration.form_elements.content.content_text

A django-fobi ContentText plugin for integration with Django REST framework. Makes use of the fobi.contrib.apps.drf_integration.fields.ContentText.

Installation
  1. Add fobi.contrib.apps.drf_integration.form_elements.content.content_text to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.apps.drf_integration.form_elements.content.content_text',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

Usage

Unlike standard fields, ContentText field is purely presentational. You’re not supposed to make write actions on it (it won’t work). Neither will it be displayed in the browsable API (list/retrieve actions). However, it will be listed in the options action call.

Sample JSON response fragment

"actions": {
    "PUT": {
        // ...
        "content_text_89c8c319-195b-487a-a44d-f59ef14a5d44": {
            "type": "content",
            "required": false,
            "read_only": true,
            "contenttype": "text",
            "content": "\n<p>\n\nLorem ipsum dolor sit amet.\n\n\n</p>\n",
            "raw": {
                "text": "Lorem ipsum dolor sit amet."
            }
        },
        // ...
    }
}

JSON response fragment explained

  • type (str): Set to “content” for all presentational form elements.
  • contenttype (str): Set to “text” for ContentText field.
  • content (str): Representation of the content. Rendered partial HTML.
  • raw (json dict): Raw attributes of the ContentText plugin. Contains “text” attribute.
fobi.contrib.apps.drf_integration.form_elements.content.content_video

A django-fobi ContentVideo plugin for integration with Django REST framework. Makes use of the fobi.contrib.apps.drf_integration.fields.ContentVideo.

Installation
  1. Add fobi.contrib.apps.drf_integration.form_elements.content.content_video to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.apps.drf_integration.form_elements.content.content_video',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

Usage

Unlike standard fields, ContentVideo field is purely presentational. You’re not supposed to make write actions on it (it won’t work). Neither will it be displayed in the browsable API (list/retrieve actions). However, it will be listed in the options action call.

Sample JSON response fragment

"actions": {
    "PUT": {
        // ...
        "content_video_41a6b951-e6f9-4f08-ada6-3b109aa9a72f": {
            "type": "content",
            "required": false,
            "read_only": true,
            "contenttype": "video",
            "content": "\n<iframe src=\"//www.youtube.com/embed/3P1qcVcs4Ik\" width=\"500\" height=\"400\" frameborder=\"0\" allowfullscreen></iframe>\n",
            "raw": {
                "title": "Cras risus ipsum faucibus",
                "url": "https://www.youtube.com/watch?v=3P1qcVcs4Ik",
                "size": "500x400"
            }
        },
        // ...
    }
}

JSON response fragment explained

  • type (str): Set to “content” for all presentational form elements.
  • contenttype (str): Set to “video” for ContentVideo field.
  • content (str): Representation of the content. Rendered partial HTML.
  • raw (json dict): Raw attributes of the ContentVideo plugin. Contains “title”, “url” and “size” attributes.

Fields

Form fields for drf_integration.

fobi.contrib.apps.drf_integration.form_elements.fields.boolean

A django-fobi BooleanField plugin for integration with Django REST framework. Makes use of the rest_framework.fields.BooleanField.

Installation
  1. Add fobi.contrib.apps.drf_integration.form_elements.fields.boolean to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.apps.drf_integration.form_elements.fields.boolean',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

fobi.contrib.apps.drf_integration.form_elements.fields.checkbox_select_multiple

A django-fobi CharField plugin for integration with Django REST framework. Makes use of the rest_framework.fields.MultipleChoiceField.

Installation
  1. Add fobi.contrib.apps.drf_integration.form_elements.fields.checkbox_select_multiple to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.apps.drf_integration.form_elements.fields.checkbox_select_multiple',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

fobi.contrib.apps.drf_integration.form_elements.fields.date

A django-fobi DateField plugin for integration with Django REST framework. Makes use of the rest_framework.fields.DateField.

Installation
  1. Add fobi.contrib.apps.drf_integration.form_elements.fields.date to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.apps.drf_integration.form_elements.fields.date',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

fobi.contrib.apps.drf_integration.form_elements.fields.date_drop_down

A django-fobi DateField plugin for integration with Django REST framework. Makes use of the rest_framework.fields.DateField.

This plugin has been made primarily for compatibility with date_drop_down plugin of the core package.

Installation
  1. Add fobi.contrib.apps.drf_integration.form_elements.fields.date_drop_down to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.apps.drf_integration.form_elements.fields.date_drop_down',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

fobi.contrib.apps.drf_integration.form_elements.fields.datetime

A django-fobi DateField plugin for integration with Django REST framework. Makes use of the rest_framework.fields.DateTimeField.

Installation
  1. Add fobi.contrib.apps.drf_integration.form_elements.fields.datetime to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.apps.drf_integration.form_elements.fields.datetime',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

fobi.contrib.apps.drf_integration.form_elements.fields.decimal

A django-fobi DecimalField plugin for integration with Django REST framework. Makes use of the rest_framework.fields.DecimalField.

Installation
  1. Add fobi.contrib.apps.drf_integration.form_elements.fields.decimal to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.apps.drf_integration.form_elements.fields.decimal',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

fobi.contrib.apps.drf_integration.form_elements.fields.email

A django-fobi EmailField plugin for integration with Django REST framework. Makes use of the rest_framework.fields.EmailField.

Installation
  1. Add fobi.contrib.apps.drf_integration.form_elements.fields.email to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.apps.drf_integration.form_elements.fields.email',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

fobi.contrib.apps.drf_integration.form_elements.fields.file

A django-fobi FileField plugin for integration with Django REST framework. Makes use of the rest_framework.fields.FileField.

Installation
  1. Add fobi.contrib.apps.drf_integration.form_elements.fields.file to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.apps.drf_integration.form_elements.fields.file',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

fobi.contrib.apps.drf_integration.form_elements.fields.float

A django-fobi FloatField plugin for integration with Django REST framework. Makes use of the rest_framework.fields.FloatField.

Installation
  1. Add fobi.contrib.apps.drf_integration.form_elements.fields.float to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.apps.drf_integration.form_elements.fields.float',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

fobi.contrib.apps.drf_integration.form_elements.fields.hidden

A django-fobi HiddenField plugin for integration with Django REST framework. Makes use of the rest_framework.fields.HiddenField.

Note, that in terms of the Django REST framework it is a read-only field. Any values posted along won’t be saved. Initial value would.

Installation
  1. Add fobi.contrib.apps.drf_integration.form_elements.fields.hidden to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.apps.drf_integration.form_elements.fields.hidden',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

fobi.contrib.apps.drf_integration.form_elements.fields.input

A django-fobi CharField plugin for integration with Django REST framework. Makes use of the rest_framework.fields.CharField.

Installation
  1. Add fobi.contrib.apps.drf_integration.form_elements.fields.input to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.apps.drf_integration.form_elements.fields.input',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

fobi.contrib.apps.drf_integration.form_elements.fields.integer

A django-fobi IntegerField plugin for integration with Django REST framework. Makes use of the rest_framework.fields.IntegerField.

Installation
  1. Add fobi.contrib.apps.drf_integration.form_elements.fields.integer to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.apps.drf_integration.form_elements.fields.integer',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

fobi.contrib.apps.drf_integration.form_elements.fields.ip_address

A django-fobi IPAddressField plugin for integration with Django REST framework. Makes use of the rest_framework.fields.IPAddressField.

Installation
  1. Add fobi.contrib.apps.drf_integration.form_elements.fields.ip_address to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.apps.drf_integration.form_elements.fields.ip_address',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

fobi.contrib.apps.drf_integration.form_elements.fields.null_boolean

A django-fobi NullBooleanField plugin for integration with Django REST framework. Makes use of the rest_framework.fields.NullBooleanField.

Installation
  1. Add fobi.contrib.apps.drf_integration.form_elements.fields.null_boolean to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.apps.drf_integration.form_elements.fields.null_boolean',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

fobi.contrib.apps.drf_integration.form_elements.fields.password

A django-fobi CharField plugin for integration with Django REST framework. Makes use of the rest_framework.fields.CharField.

Installation
  1. Add fobi.contrib.apps.drf_integration.form_elements.fields.password to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.apps.drf_integration.form_elements.fields.password',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

fobi.contrib.apps.drf_integration.form_elements.fields.radio

A django-fobi CharField plugin for integration with Django REST framework. Makes use of the rest_framework.fields.ChoiceField.

Installation
  1. Add fobi.contrib.apps.drf_integration.form_elements.fields.radio to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.apps.drf_integration.form_elements.fields.radio',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

fobi.contrib.apps.drf_integration.form_elements.fields.range_select

A django-fobi ChoiceField plugin for integration with Django REST framework. Makes use of the rest_framework.fields.ChoiceField.

Installation
  1. Add fobi.contrib.apps.drf_integration.form_elements.fields.range_select to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.apps.drf_integration.form_elements.fields.range_select',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

fobi.contrib.apps.drf_integration.form_elements.fields.regex

A django-fobi RegexField plugin for integration with Django REST framework. Makes use of the rest_framework.fields.RegexField.

Installation
  1. Add fobi.contrib.apps.drf_integration.form_elements.fields.regex to the INSTALLED_APPS in your settings.py.
INSTALLED_APPS = (
    # ...
    'fobi.contrib.apps.drf_integration.form_elements.fields.regex',
    # ...
)
  1. In the terminal type:
./manage.py fobi_sync_plugins
  1. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.
fobi.contrib.apps.drf_integration.form_elements.fields.select

A django-fobi ChoiceField plugin for integration with Django REST framework. Makes use of the rest_framework.fields.ChoiceField.

Installation
  1. Add fobi.contrib.apps.drf_integration.form_elements.fields.select to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.apps.drf_integration.form_elements.fields.select',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple

A django-fobi CharField plugin for integration with Django REST framework. Makes use of the rest_framework.fields.MultipleChoiceField.

Installation
  1. Add fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple

A django-fobi CharField plugin for integration with Django REST framework. Makes use of the rest_framework.fields.MultipleChoiceField.

Installation
  1. Add fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

fobi.contrib.apps.drf_integration.form_elements.fields.slider

A django-fobi ChoiceField plugin for integration with Django REST framework. Makes use of the rest_framework.fields.ChoiceField.

Installation
  1. Add fobi.contrib.apps.drf_integration.form_elements.fields.slider to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.apps.drf_integration.form_elements.fields.slider',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

fobi.contrib.apps.drf_integration.form_elements.fields.slug

A django-fobi SlugField plugin for integration with Django REST framework. Makes use of the rest_framework.fields.SlugField.

Installation
  1. Add fobi.contrib.apps.drf_integration.form_elements.fields.slug to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.apps.drf_integration.form_elements.fields.slug',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

fobi.contrib.apps.drf_integration.form_elements.fields.text

A django-fobi CharField plugin for integration with Django REST framework. Makes use of the rest_framework.fields.CharField.

Installation
  1. Add fobi.contrib.apps.drf_integration.form_elements.fields.text to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.apps.drf_integration.form_elements.fields.text',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

fobi.contrib.apps.drf_integration.form_elements.fields.textarea

A django-fobi CharField plugin for integration with Django REST framework. Makes use of the rest_framework.fields.CharField.

Installation
  1. Add fobi.contrib.apps.drf_integration.form_elements.fields.textarea to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.apps.drf_integration.form_elements.fields.textarea',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

fobi.contrib.apps.drf_integration.form_elements.fields.time

A django-fobi TimeField plugin for integration with Django REST framework. Makes use of the rest_framework.fields.TimeField.

Installation
  1. Add fobi.contrib.apps.drf_integration.form_elements.fields.time to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.apps.drf_integration.form_elements.fields.time',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

fobi.contrib.apps.drf_integration.form_elements.fields.url

A django-fobi URLField plugin for integration with Django REST framework. Makes use of the rest_framework.fields.URLField.

Installation
  1. Add fobi.contrib.apps.drf_integration.form_elements.fields.time to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.apps.drf_integration.form_elements.fields.url',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

Form handlers

Form handlers for drf_integration.

fobi.contrib.apps.drf_integration.form_handlers.db_store

A django-fobi Mail form handler plugin for integration with Django REST framework. Saves submitted form data into the SavedFormDataEntry model.

Installation
  1. Add fobi.contrib.apps.drf_integration.form_handlers.db_store to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.apps.drf_integration.form_handlers.db_store',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py migrate
    
    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

fobi.contrib.apps.drf_integration.form_handlers.http_repost

A django-fobi HTTP repost form handler plugin for integration with Django REST framework. Submits the form to another endpoint specified.

Installation
  1. Add fobi.contrib.apps.drf_integration.form_handlers.http_respost to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.apps.drf_integration.form_handlers.http_repost',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

fobi.contrib.apps.drf_integration.form_handlers.mail

A django-fobi Mail form handler plugin for integration with Django REST framework. Submits the form data by email to the specified email address.

Installation
  1. Add fobi.contrib.apps.drf_integration.form_handlers.mail to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.apps.drf_integration.form_handlers.mail',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py migrate
    
    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

fobi.contrib.apps.feincms_integration

A django-fobi integration with FeinCMS.

Prerequisites

Tested with FeinCMS 1.10, 1.12 and 1.13 only. Might work on earlier (or later) versions as well.

Installation

your_project/settings.py

See the example settings file.

INSTALLED_APPS = list(INSTALLED_APPS)
INSTALLED_APPS += [
    'feincms',  # FeinCMS

    'fobi.contrib.apps.feincms_integration',  # Fobi FeinCMS app

    'page',  # Example
]

FEINCMS_RICHTEXT_INIT_CONTEXT = {
    'TINYMCE_JS_URL': STATIC_URL + 'tiny_mce/tiny_mce.js',
}
your_project/page/models.py
from django.utils.translation import ugettext_lazy as _

from feincms.module.page.models import Page
from feincms.content.raw.models import RawContent
from feincms.content.richtext.models import RichTextContent
# Import the ``django-fobi`` widget.
from fobi.contrib.apps.feincms_integration.widgets import FobiFormWidget

Page.register_extensions('feincms.module.extensions.translations',)

# Register basic template.
Page.register_templates(
    {
        'title': _(u"Base template"),
        'path': 'page/base.html',
        'key': 'page_base',
        'regions': (
            ('main', _(u"Main")),
            ('sidebar', _(u"Sidebar")),
        )
    },
    )

# Standard content types
Page.create_content_type(RawContent)
Page.create_content_type(RichTextContent)

# Register the ``django-fobi`` widget.
Page.create_content_type(FobiFormWidget)
your_project/admin.py
from django.contrib import admin

from feincms.module.page.modeladmins import PageAdmin

from page.models import Page

admin.site.register(Page, PageAdmin)
Information for developers
Template rendering

The embed FeinCMS widget is rendered with use of two theme templates:

  • view_embed_form_entry_ajax_template: Used for rendering the form.
  • embed_form_entry_submitted_ajax_template: Used for rendering the form sent event.
Using custom templates for rendering the widget

In the widget, you can specify a template which you want to be used for rendering the form or the form-sent event.

Example:

FOBI_FEINCMS_INTEGRATION_FORM_TEMPLATE_CHOICES = (
    ("yourapp/custom_view_embed_form_v1.html",
     "Custom embed form view template #1"),
    ("yourapp/custom_view_embed_form_v2.html",
     "Custom embed form view template #2"),
)

Same goes for form-sent templates.

FOBI_FEINCMS_INTEGRATION_SUCCESS_PAGE_TEMPLATE_CHOICES = (
    ("yourapp/custom_embed_form_submitted_v1.html",
     "Custom form-sent template #1"),
    ("yourapp/custom_embed_form_submitted_v2.html",
     "Custom form-sent template #2"),
)

Registering a template in the FORM_TEMPLATE_CHOICES makes it available for all the themes. If you rather want to use different custom templates for different themes, use the FOBI_CUSTOM_THEME_DATA as shown in the example below.

FOBI_CUSTOM_THEME_DATA = {
    'bootstrap3': {
        'feincms_integration': {
            'form_template_choices': [
                ('fobi/bootstrap3_extras/view_embed_form.html',
                 "Custom bootstrap3 embed form view template"),
            ],
            'success_page_template_choices': [
                ('fobi/bootstrap3_extras/embed_form_submitted.html',
                 "Custom bootstrap3 embed form entry submitted template"),
            ],
        },
    },
    'foundation5': {
        'feincms_integration': {
            'form_template_choices': [
                ('fobi/foundation5_extras/view_embed_form.html',
                 "Custom foundation5 embed form view template"),
            ],
            'success_page_template_choices': [
                ('fobi/foundation5_extras/embed_form_submitted.html',
                 "Custom foundation5 embed form entry submitted template"),
            ],
        },
    },
}

Usage

The fobi.contrib.apps.feincms_integration.widgets.FobiFormWidget consists of the following fields:

  • Form: The form to be used.
  • Form template name: Template to be used to render the embed form.
  • Hide form title: If checked, no form title would be shown.
  • Form title: Overrides the standard form title.
  • Submit button text: Overrides the default submit button text.
  • Success page template name: Template to be used to render the embed form-sent event.
  • Hide success page title: If checked, no form-sent title would be shown.
  • Success page title: Overrides the form-sent title.
  • Success page text: Overrides the form-sent text.

fobi.contrib.apps.mezzanine_integration

A django-fobi integration with Mezzanine.

Prerequisites

Tested with Mezzanine 3.1.10 and 4.2.3 only. Might work on earlier (or later) versions as well.

Installation

Versions

See the requirements files:

your_project/settings.py

See the example settings file.

INSTALLED_APPS = list(INSTALLED_APPS)
INSTALLED_APPS += [
    # Standard mezzanine apps

    'fobi.contrib.apps.mezzanine_integration',  # Fobi Mezzanine app
]

Information for developers

Template rendering

The form embed into Mezzanine page is rendered with use of two theme templates:

  • view_embed_form_entry_ajax_template: Used for rendering the form.
  • embed_form_entry_submitted_ajax_template: Used for rendering the form sent event.
Using custom templates for rendering the form

In the widget, you can specify a template which you want to be used for rendering the form or the form-sent event.

Example:

FOBI_MEZZANINE_INTEGRATION_FORM_TEMPLATE_CHOICES = (
    ("yourapp/custom_view_embed_form_v1.html",
     "Custom embed form view template #1"),
    ("yourapp/custom_view_embed_form_v2.html",
     "Custom embed form view template #2"),
)

Same goes for form-sent templates.

FOBI_MEZZANINE_INTEGRATION_SUCCESS_PAGE_TEMPLATE_CHOICES = (
    ("yourapp/custom_embed_form_submitted_v1.html",
     "Custom form-sent template #1"),
    ("yourapp/custom_embed_form_submitted_v2.html",
     "Custom form-sent template #2"),
)

Registering a template in the FORM_TEMPLATE_CHOICES makes it available for all the themes. If you rather want to use different custom templates for different themes, use the FOBI_CUSTOM_THEME_DATA as shown in the example below.

FOBI_CUSTOM_THEME_DATA = {
    'bootstrap3': {
        'mezzanine_integration': {
            'form_template_choices': [
                ('fobi/bootstrap3_extras/view_embed_form.html',
                 "Custom bootstrap3 embed form view template"),
            ],
            'success_page_template_choices': [
                ('fobi/bootstrap3_extras/embed_form_submitted.html',
                 "Custom bootstrap3 embed form entry submitted template"),
            ],
        },
    },
    'foundation5': {
        'mezzanine_integration': {
            'form_template_choices': [
                ('fobi/foundation5_extras/view_embed_form.html',
                 "Custom foundation5 embed form view template"),
            ],
            'success_page_template_choices': [
                ('fobi/foundation5_extras/embed_form_submitted.html',
                 "Custom foundation5 embed form entry submitted template"),
            ],
        },
    },
}

Usage

The fobi page model

The fobi.contrib.apps.mezzanine_integration.models.FobiFormPage consists of the following fields:

  • Form: The form to be used.
  • Form template name: Template to be used to render the embed form.
  • Hide form title: If checked, no form title would be shown.
  • Form title: Overrides the standard form title.
  • Submit button text: Overrides the default submit button text.
  • Success page template name: Template to be used to render the embed form-sent event.
  • Hide success page title: If checked, no form-sent title would be shown.
  • Success page title: Overrides the form-sent title.
  • Success page text: Overrides the form-sent text.
Steps described
  1. If you use the mezzanine example project, to start go to the http://localhost:8003/fobi/ URL and create a form.
  2. Then go to http://localhost:8003/admin/pages/page/ and add a new Fobi form page.
  3. Choose the form and optionally - override the form settings and then save the page.
  4. See the page in the front-end.

fobi.contrib.plugins.form_elements.content.content_image

A Fobi Image form element plugin.

Installation

  1. Add fobi.contrib.plugins.form_elements.content.content_image to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'easy_thumbnails',
        'fobi.contrib.plugins.form_elements.content.content_image',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

  4. Additionally, for the fine tuning, see the fobi.contrib.plugins.form_elements.content.content_image.defaults module. If necessary, override the settings by prepending FOBI_PLUGIN_CONTENT_IMAGE_ to the desired variable name from the above mentioned defaults module.

fobi.contrib.plugins.form_elements.content.content_image_url

A Fobi ImageURL form element plugin.

Installation

  1. Add fobi.contrib.plugins.form_elements.content.content_image_url to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.plugins.form_elements.content.content_image_url',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

  4. Additionally, for the fine tuning, see the fobi.contrib.plugins.form_elements.content.content_image_url.defaults module. If necessary, override the settings by prepending FOBI_PLUGIN_CONTENT_IMAGE_URL_ to the desired variable name from the above mentioned defaults module.

fobi.contrib.plugins.form_elements.content.content_text

A Fobi Text form element plugin.

Installation

  1. Add fobi.contrib.plugins.form_elements.content.content_text to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.plugins.form_elements.content.content_text',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

  4. Additionally, for the fine tuning, see the fobi.contrib.plugins.form_elements.content.content_text.defaults module. If necessary, override the settings by prepending FOBI_PLUGIN_CONTENT_TEXT_ to the desired variable name from the above mentioned defaults module.

    By default the content of the text field is stripped using either the awesome bleach library or if bleach is not installed just Django’s own strip_tags function. To configure the strip (bleach only) behaviour, two settings are introduced:

    - ALLOWED_TAGS:
    - ALLOWED_ATTRIBUTES:
    

    The default values are:

    ALLOWED_TAGS = [
        'a',
        'abbr',
        'acronym',
        'b',
        'blockquote',
        'code',
        'em',
        'i',
        'li',
        'ol',
        'strong',
        'ul',
    ]
    
    ALLOWED_ATTRIBUTES = {
        'a': ['href', 'title'],
        'abbr': ['title'],
        'acronym': ['title'],
    }
    

fobi.contrib.plugins.form_elements.content.content_video

A Fobi Video form element plugin.

Installation

  1. Add fobi.contrib.plugins.form_elements.content.content_video to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.plugins.form_elements.content.content_video',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

  4. Additionally, for the fine tuning, see the fobi.contrib.plugins.form_elements.content.content_video.defaults module. If necessary, override the settings by prepending FOBI_PLUGIN_CONTENT_VIDEO_ to the desired variable name from the above mentioned defaults module.

fobi.contrib.plugins.form_elements.fields.boolean

A Fobi Boolean form field plugin. Makes use of the django.forms.fields.BooleanField.

Installation

  1. Add fobi.contrib.plugins.form_elements.fields.boolean to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.plugins.form_elements.fields.boolean',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

fobi.contrib.plugins.form_elements.fields.checkbox_select_multiple

A Fobi Select Multiple form field plugin. Makes use of the django.forms.fields.MultipleChoiceField and django.forms.widgets.CheckboxSelectMultiple.

Installation

  1. Add fobi.contrib.plugins.form_elements.fields.checkbox_select_multiple to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.plugins.form_elements.fields.checkbox_select_multiple',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

  4. By default, the submitted form value of select_multiple elements is label (human readable representation of the value chosen). However, that part of the behaviour has been made configurable. You can choose between the following options:

    Consider the following list of (value, label) choices (the first element in the tuple is value, the second element is label):

    [
        ('alpha', 'Alpha'),
        ('beta', 'Beta'),
        ('gamma', 'Gamma'),
    ]
    
    • “val”: value (example: “alpha”).
    • “repr” (default): label (example: “Alpha”).
    • “mix”: value (label) (example: “Alpha (alpha)”).

    Simply set the FOBI_FORM_ELEMENT_CHECKBOX_SELECT_MULTIPLE_SUBMIT_VALUE_AS assign one of the following values: “val”, “repr” or “mix” to get the desired behaviour.

Usage

You should be entering a single choice per line. Choice might consist of just a single value or value/label pair.

For example:

1
2
alpha, Alpha
beta, Beta
omega

The following HTML would be made of:

<ul id="id_NAME_OF_THE_ELEMENT">
  <li>
    <label for="id_NAME_OF_THE_ELEMENT_0">
      <input class="form-control" id="id_NAME_OF_THE_ELEMENT_0" name="NAME_OF_THE_ELEMENT" type="checkbox" value="1" /> 1
    </label>
  </li>
  <li>
    <label for="id_NAME_OF_THE_ELEMENT_1">
      <input class="form-control" id="id_NAME_OF_THE_ELEMENT_1" name="NAME_OF_THE_ELEMENT" type="checkbox" value="2" /> 2
    </label>
  </li>
  <li>
    <label for="id_NAME_OF_THE_ELEMENT_2">
      <input class="form-control" id="id_NAME_OF_THE_ELEMENT_2" name="NAME_OF_THE_ELEMENT" type="checkbox" value="alpha" /> Alpha
    </label>
  </li>
  <li>
    <label for="id_NAME_OF_THE_ELEMENT_3">
      <input class="form-control" id="id_NAME_OF_THE_ELEMENT_3" name="NAME_OF_THE_ELEMENT" type="checkbox" value="beta" /> Beta
    </label>
  </li>
  <li>
    <label for="id_NAME_OF_THE_ELEMENT_4">
      <input class="form-control" id="id_NAME_OF_THE_ELEMENT_4" name="NAME_OF_THE_ELEMENT" type="checkbox" value="omega" /> omega
    </label>
  </li>
</ul>

fobi.contrib.plugins.form_elements.fields.date

A Fobi Date form field plugin. Makes use of the django.forms.fields.DateField and django.forms.widgets.DateInput.

Installation

  1. Add fobi.contrib.plugins.form_elements.fields.date to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.plugins.form_elements.fields.date',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

fobi.contrib.plugins.form_elements.fields.date_drop_down

A Fobi Birthday form field plugin. Makes use of the django.forms.fields.DateField and django.forms.extras.widgets.SelectDateWidget.

Installation

  1. Add fobi.contrib.plugins.form_elements.fields.date_drop_down to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.plugins.form_elements.fields.date_drop_down',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

fobi.contrib.plugins.form_elements.fields.datetime

A Fobi DateTime form field plugin. Makes use of the django.forms.fields.DateTimeField and django.forms.widgets.DateTimeInput.

Installation

  1. Add fobi.contrib.plugins.form_elements.fields.datetime to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.plugins.form_elements.fields.datetime',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

fobi.contrib.plugins.form_elements.fields.decimal

A Fobi Decimal form field plugin. Makes use of the django.forms.fields.DecimalField and django.forms.widgets.NumberInput (falling back to django.forms.widgets.TextInput for older Django versions).

Installation

  1. Add fobi.contrib.plugins.form_elements.fields.decimal to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.plugins.form_elements.fields.decimal',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

fobi.contrib.plugins.form_elements.fields.email

A Fobi Email form field plugin. Makes use of the django.forms.fields.EmailField and django.forms.widgets.TextInput.

Installation

  1. Add fobi.contrib.plugins.form_elements.fields.email to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.plugins.form_elements.fields.email',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

fobi.contrib.plugins.form_elements.fields.file

A Fobi File form field plugin. Makes use of the django.forms.fields.FileField and django.forms.widgets.ClearableFileInput.

Installation

  1. Add fobi.contrib.plugins.form_elements.fields.file to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.plugins.form_elements.fields.file',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

  4. By default uploaded files are stored in the “fobi_plugins/file” directory of the media root. If you want to change the directory location, set the FOBI_PLUGIN_FIELDS_FILE_FILES_UPLOAD_DIR value to the desired (relative) path.

fobi.contrib.plugins.form_elements.fields.float

A Fobi Integer form field plugin. Makes use of the django.forms.fields.FloatField and django.forms.widgets.NumberInput (falling back to django.forms.widgets.TextInput for older Django versions).

Installation

  1. Add fobi.contrib.plugins.form_elements.fields.float to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.plugins.form_elements.fields.float',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

fobi.contrib.plugins.form_elements.fields.hidden

A Fobi Hidden form field plugin. Makes use of the django.forms.fields.CharField and django.forms.widgets.HiddenInput.

Installation

  1. Add fobi.contrib.plugins.form_elements.fields.hidden to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.plugins.form_elements.fields.hidden',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

fobi.contrib.plugins.form_elements.fields.input

A generic input form field plugin. Makes use of the django.forms.fields.Field and django.forms.widgets.Input. Comes with a lot of options you likely won’t use every day.

The full list of supported HTML properties is listed below:

  • autocomplete
  • autofocus
  • disabled
  • list
  • max
  • min
  • multiple
  • pattern
  • placeholder
  • readonly
  • step
  • type

See w3schools.com for further explanations.

Installation

  1. Add fobi.contrib.plugins.form_elements.fields.input to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.plugins.form_elements.fields.input',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

fobi.contrib.plugins.form_elements.fields.integer

A Fobi Integer form field plugin. Makes use of the django.forms.fields.IntegerField and django.forms.widgets.NumberInput (falling back to django.forms.widgets.TextInput for older Django versions).

Installation

  1. Add fobi.contrib.plugins.form_elements.fields.integer to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.plugins.form_elements.fields.integer',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

fobi.contrib.plugins.form_elements.fields.ip_address

A Fobi Text form field plugin. Makes use of the django.forms.fields.GenericIPAddressField and django.forms.widgets.TextInput.

Installation

  1. Add fobi.contrib.plugins.form_elements.fields.ip_address to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.plugins.form_elements.fields.ip_address',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

fobi.contrib.plugins.form_elements.fields.null_boolean

A Fobi NullBoolean form field plugin. Makes use of the django.forms.fields.NullBooleanField and django.forms.widgets.NullBooleanSelect.

Installation

  1. Add fobi.contrib.plugins.form_elements.fields.null_boolean to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.plugins.form_elements.fields.null_boolean',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

fobi.contrib.plugins.form_elements.fields.password

A Fobi Password form field plugin. Makes use of the django.forms.fields.CharField and django.forms.widgets.PasswordInput.

Installation

  1. Add fobi.contrib.plugins.form_elements.fields.password to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.plugins.form_elements.fields.password',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

fobi.contrib.plugins.form_elements.fields.radio

A Fobi Radio form field plugin. Makes use of the django.forms.fields.ChoiceField and django.forms.widgets.RadioSelect.

Installation

  1. Add fobi.contrib.plugins.form_elements.fields.radio to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.plugins.form_elements.fields.radio',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

  4. By default, the submitted form value of radio elements is label (human readable representation of the value chosen). However, that part of the behaviour has been made configurable. You can choose between the following options:

    Consider the following list of (value, label) choices (the first element in the tuple is value, the second element is label):

    [
        ('alpha', 'Alpha'),
        ('beta', 'Beta'),
        ('gamma', 'Gamma'),
    ]
    
    - "val": `value` (example: "alpha").
    - "repr" (default): `label` (example: "Alpha").
    - "mix": `value (label)` (example: "Alpha (alpha)").
    

    Simply set the FOBI_FORM_ELEMENT_RADIO_SUBMIT_VALUE_AS assign one of the following values: “val”, “repr” or “mix” to get the desired behaviour.

Usage

You should be entering a single choice per line. Choice might consist of just a single value or value/label pair.

For example:

1
2
alpha, Alpha
beta, Beta
omega

The following HTML would be made of:

<select id="id_NAME_OF_THE_ELEMENT" name="NAME_OF_THE_ELEMENT">
  <option value="1">1</option>
  <option value="2">2</option>
  <option value="alpha">Alpha</option>
  <option value="beta">Beta</option>
  <option value="omega">omega</option>
</select>

fobi.contrib.plugins.form_elements.fields.range_select

A Fobi RangeSelect form field plugin. Makes use of the django.forms.fields.ChoiceField and django.forms.widgets.Select.

Installation

  1. Add fobi.contrib.plugins.form_elements.fields.range_select to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.plugins.form_elements.fields.range_select',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

  4. Ranges are specified within the given min/max values. The default values are:

    - INITIAL: 50
    - INITIAL_MAX_VALUE: 100
    - INITIAL_MIN_VALUE: 0
    - MIN_VALUE: 0
    - MAX_VALUE: 100
    - STEP: 1
    

    However, you can override each of them in the settings of your project by prefixing correspondent names with FOBI_FORM_ELEMENT_RANGE_SELECT_:

    - FOBI_FORM_ELEMENT_RANGE_SELECT_INITIAL
    - FOBI_FORM_ELEMENT_RANGE_SELECT_INITIAL_MAX_VALUE
    - FOBI_FORM_ELEMENT_RANGE_SELECT_INITIAL_MIN_VALUE
    - FOBI_FORM_ELEMENT_RANGE_SELECT_MIN_VALUE
    - FOBI_FORM_ELEMENT_RANGE_SELECT_MAX_VALUE
    - FOBI_FORM_ELEMENT_RANGE_SELECT_STEP
    

fobi.contrib.plugins.form_elements.fields.regex

A Fobi Text form field plugin. Makes use of the django.forms.fields.RegexField and django.forms.widgets.TextInput.

Installation

  1. Add fobi.contrib.plugins.form_elements.fields.regex to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.plugins.form_elements.fields.regex',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

fobi.contrib.plugins.form_elements.fields.duration

A Fobi Select form field plugin. Makes use of the django.forms.fields.DurationField.

Installation

  1. Add fobi.contrib.plugins.form_elements.fields.duration to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.plugins.form_elements.fields.duration',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

Usage

Next to standard field attributes, duration plugin accepts the following attributes (all integers):

  • weeks:
  • days:
  • hours
  • minutes:
  • seconds:

All being used to form a datetime.timedelta value with the arguments mentioned above.

Initial value should be a properly formatted string.

3 days, 23:10:53
09:30:00

fobi.contrib.plugins.form_elements.fields.select_model_object

A Fobi Select Model Object form field plugin. Makes use of the django.forms.models.ModelChoiceField and django.forms.widgets.Select.

Installation

  1. Add fobi.contrib.plugins.form_elements.fields.select_model_object to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.plugins.form_elements.fields.select_model_object',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

  4. Make sure to take a look at fobi.contrib.plugins.form_elements.fields.select_model_object.defaults.IGNORED_MODELS. If necessary, override it in your settings as shown in the example below:

    FOBI_FORM_ELEMENT_SELECT_MODEL_OBJECT_IGNORED_MODELS = [
        'auth.User',
        'auth.Group',
    ]
    
  5. By default, the submitted form value of select_model_object elements is app_label.model_name.object_pk.object_repr. However, that part of the behaviour has been made configurable. You can choose between the following options:

    - "val": `app_label.model_name.object_pk.object_repr`.
    - "repr": `object_repr` (uses the ``__unicode__`` method of the model).
    - "mix" (default): `app_label.model_name.object_pk.object_repr`.
    

    Simply set the FOBI_FORM_ELEMENT_SELECT_MODEL_OBJECT_SUBMIT_VALUE_AS assign one of the following values: “val”, “repr” or “mix” to get the desired behaviour.

fobi.contrib.plugins.form_elements.fields.select_mptt_model_object

A Fobi Select MPTT Model Object form field plugin. Makes use of the mptt.fields.TreeNodeChoiceField and django.forms.widgets.Select.

Installation

Install django-mptt

Taken from django-mptt Getting started.

  1. Download django-mptt using pip by running:
pip install django-mptt
  1. Add mptt to the INSTALLED_APPS in your settings.py.
Install select_mptt_model_object plugin
  1. Add mptt and fobi.contrib.plugins.form_elements.fields.select_mptt_model_object to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'mptt',
        'fobi.contrib.plugins.form_elements.fields.select_mptt_model_object',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

  4. Make sure to take a look at fobi.contrib.plugins.form_elements.fields.select_mptt_model_object.defaults.IGNORED_MODELS. If necessary, override it in your settings as shown in the example below:

    FOBI_FORM_ELEMENT_SELECT_MPTT_MODEL_OBJECT_IGNORED_MODELS = [
        'auth.User',
        'auth.Group',
    ]
    
  5. By default, the submitted form value of select_mptt_model_object elements is app_label.model_name.object_pk.object_repr. However, that part of the behaviour has been made configurable. You can choose between the following options:

    - "val": `app_label.model_name.object_pk.object_repr`.
    - "repr": `object_repr` (uses the ``__unicode__`` method of the model).
    - "mix" (default): `app_label.model_name.object_pk.object_repr`.
    

    Simply set the FOBI_FORM_ELEMENT_SELECT_MPTT_MODEL_OBJECT_SUBMIT_VALUE_AS assign one of the following values: “val”, “repr” or “mix” to get the desired behaviour.

fobi.contrib.plugins.form_elements.fields.select_multiple

A Fobi Select Multiple form field plugin. Makes use of the django.forms.fields.MultipleChoiceField and django.forms.widgets.SelectMultiple.

Installation

  1. Add fobi.contrib.plugins.form_elements.fields.select_multiple to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.plugins.form_elements.fields.select_multiple',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

  4. By default, the submitted form value of select_multiple elements is label (human readable representation of the value chosen). However, that part of the behaviour has been made configurable. You can choose between the following options:

    Consider the following list of (value, label) choices (the first element in the tuple is value, the second element is label):

    [
        ('alpha', 'Alpha'),
        ('beta', 'Beta'),
        ('gamma', 'Gamma'),
    ]
    
    - "val": `value` (example: "alpha").
    - "repr" (default): `label` (example: "Alpha").
    - "mix": `value (label)` (example: "Alpha (alpha)").
    

    Simply set the FOBI_FORM_ELEMENT_SELECT_MULTIPLE_SUBMIT_VALUE_AS assign one of the following values: “val”, “repr” or “mix” to get the desired behaviour.

Usage

You should be entering a single choice per line. Choice might consist of just a single value or value/label pair.

For example:

1
2
alpha, Alpha
beta, Beta
omega

The following HTML would be made of:

<select id="id_NAME_OF_THE_ELEMENT" name="NAME_OF_THE_ELEMENT">
  <option value="1">1</option>
  <option value="2">2</option>
  <option value="alpha">Alpha</option>
  <option value="beta">Beta</option>
  <option value="omega">omega</option>
</select>

fobi.contrib.plugins.form_elements.fields.select_multiple_model_objects

A Fobi Select Multiple Model Objects form field plugin. Makes use of the django.forms.models.ModelMultipleChoiceField and django.forms.widgets.SelectMultiple.

Installation

  1. Add fobi.contrib.plugins.form_elements.fields.select_multiple_model_objects to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.plugins.form_elements.fields.select_multiple_model_objects',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

  4. Make sure to take a look at fobi.contrib.plugins.form_elements.fields.select_multiple_model_objects.defaults.IGNORED_MODELS. If necessary, override it in your settings as shown in the example below:

    FOBI_FORM_ELEMENT_SELECT_MULTIPLE_MODEL_OBJECTS_IGNORED_MODELS = [
        'auth.User',
        'auth.Group',
    ]
    
  5. By default, the submitted form value of select_multiple_model_objects elements is app_label.model_name.object_pk.object_repr. However, that part of the behaviour has been made configurable. You can choose between the following options:

    - "val": `app_label.model_name.object_pk.object_repr`.
    - "repr": `object_repr` (uses the ``__unicode__`` method of the model).
    - "mix" (default): `app_label.model_name.object_pk.object_repr`.
    

    Simply set the FOBI_FORM_ELEMENT_SELECT_MULTIPLE_MODEL_OBJECTS_SUBMIT_VALUE_AS assign one of the following values: “val”, “repr” or “mix” to get the desired behaviour.

fobi.contrib.plugins.form_elements.fields.select_multiple_mptt_model_objects

A Fobi Select Multiple MPTT Model Objects form field plugin. Makes use of the mptt.forms.TreeNodeMultipleChoiceField and django.forms.widgets.SelectMultiple.

Installation

Install django-mptt

Taken from django-mptt Getting started.

  1. Download django-mptt using pip by running:
pip install django-mptt
  1. Add mptt to the INSTALLED_APPS in your settings.py.
Install select_multiple_mptt_model_objects plugin
  1. Add fobi.contrib.plugins.form_elements.fields.select_multiple_mptt_model_objects to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'mptt',
        'fobi.contrib.plugins.form_elements.fields.select_multiple_mptt_model_objects',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

  4. Make sure to take a look at fobi.contrib.plugins.form_elements.fields.select_multiple_mptt_model_objects.defaults.IGNORED_MODELS. If necessary, override it in your settings as shown in the example below:

    FOBI_FORM_ELEMENT_SELECT_MULTIPLE_MPTT_MODEL_OBJECTS_IGNORED_MODELS = [
        'auth.User',
        'auth.Group',
    ]
    
  5. By default, the submitted form value of select_multiple_mptt_model_objects elements is app_label.model_name.object_pk.object_repr. However, that part of the behaviour has been made configurable. You can choose between the following options:

    - "val": `app_label.model_name.object_pk.object_repr`.
    - "repr": `object_repr` (uses the ``__unicode__`` method of the model).
    - "mix" (default): `app_label.model_name.object_pk.object_repr`.
    

    Simply set the FOBI_FORM_ELEMENT_SELECT_MULTIPLE_MPTT_MODEL_OBJECTS_SUBMIT_VALUE_AS assign one of the following values: “val”, “repr” or “mix” to get the desired behaviour.

fobi.contrib.plugins.form_elements.fields.select_multiple_with_max

A Fobi Select Multiple form field plugin with max choices. Makes use of the django.forms.widgets.SelectMultiple.

Installation

  1. Add fobi.contrib.plugins.form_elements.fields.select_multiple_with_max to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.plugins.form_elements.fields.select_multiple_with_max',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

  4. By default, the submitted form value of select_multiple_with_max elements is label (human readable representation of the value chosen). However, that part of the behaviour has been made configurable. You can choose between the following options:

    Consider the following list of (value, label) choices (the first element in the tuple is value, the second element is label):

    [
        ('alpha', 'Alpha'),
        ('beta', 'Beta'),
       ('gamma', 'Gamma'),
    ]
    
    - "val": `value` (example: "alpha").
    - "repr" (default): `label` (example: "Alpha").
    - "mix": `value (label)` (example: "Alpha (alpha)").
    

    Simply set the FOBI_FORM_ELEMENT_SELECT_MULTIPLE_WITH_MAX_SUBMIT_VALUE_AS assign one of the following values: “val”, “repr” or “mix” to get the desired behaviour.

Usage

You should be entering a single choice per line. Choice might consist of just a single value or value/label pair. If you enter an integer in the ‘max_choices’ field, the user can choose only <max_choices> or less choices.

For example:

1
2
alpha, Alpha
beta, Beta
omega

The following HTML would be made of:

<select id="id_NAME_OF_THE_ELEMENT" name="NAME_OF_THE_ELEMENT">
  <option value="1">1</option>
  <option value="2">2</option>
  <option value="alpha">Alpha</option>
  <option value="beta">Beta</option>
  <option value="omega">omega</option>
</select>

fobi.contrib.plugins.form_elements.fields.slider

A Fobi Percentage form field plugin. Makes use of the django.forms.fields.ChoiceField and django.forms.widgets.Select.

Installation

  1. Add fobi.contrib.plugins.form_elements.fields.slider to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.plugins.form_elements.fields.slider',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

  4. Ranges are specified within the given min/max values. The default values are:

    - INITIAL: 50
    - INITIAL_MAX_VALUE: 100
    - INITIAL_MIN_VALUE: 0
    - MIN_VALUE: 0
    - MAX_VALUE: 100
    - STEP: 1
    

    However, you can override each of them in the settings of your project by prefixing correspondent names with FOBI_FORM_ELEMENT_SLIDER_:

    - FOBI_FORM_ELEMENT_SLIDER_INITIAL
    - FOBI_FORM_ELEMENT_SLIDER_INITIAL_MAX_VALUE
    - FOBI_FORM_ELEMENT_SLIDER_INITIAL_MIN_VALUE
    - FOBI_FORM_ELEMENT_SLIDER_MIN_VALUE
    - FOBI_FORM_ELEMENT_SLIDER_MAX_VALUE
    - FOBI_FORM_ELEMENT_SLIDER_STEP
    

fobi.contrib.plugins.form_elements.fields.text

A Fobi Text form field plugin. Makes use of the django.forms.fields.CharField and django.forms.widgets.TextInput.

Installation

  1. Add fobi.contrib.plugins.form_elements.fields.text to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.plugins.form_elements.fields.text',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

fobi.contrib.plugins.form_elements.fields.textarea

A Fobi Textarea form field plugin. Makes use of the django.forms.fields.CharField and django.forms.widgets.Textarea.

Installation

  1. Add fobi.contrib.plugins.form_elements.fields.textarea to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.plugins.form_elements.fields.textarea',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

fobi.contrib.plugins.form_elements.fields.time

A Fobi DateTime form field plugin. Makes use of the django.forms.fields.TimeField and django.forms.widgets.TextInput.

Installation

  1. Add fobi.contrib.plugins.form_elements.fields.time to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.plugins.form_elements.fields.time',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

fobi.contrib.plugins.form_elements.fields.url

A Fobi URL form field plugin. Makes use of the django.forms.fields.URLField and django.forms.widgets.URLInput falling back to django.forms.widgets.TextInput for older Django versions.

Installation

  1. Add fobi.contrib.plugins.form_elements.fields.url to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.plugins.form_elements.fields.url',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

fobi.contrib.plugins.form_elements.security.captcha

A CAPTCHA form field plugin. Makes use of the django-simple-captcha.

Prerequisites

You will need libfreetype6, otherwise django-captcha won’t work.

sudo apt-get install libfreetype6-dev

Installation

Install django-simple-captcha

Taken from django-simple-captcha installation instructions.

  1. Download django-simple-captcha using pip by running:

    pip install django-simple-captcha
    
  2. Add captcha to the INSTALLED_APPS in your settings.py.

  3. Run python manage.py syncdb (or python manage.py migrate if you are managing database migrations via South) to create the required database tables.

  4. Add an entry to your urls.py:

    urlpatterns += [
        url(r'^captcha/', include('captcha.urls')),
    ]
    
Install fobi Captcha plugin
  1. Add fobi.contrib.plugins.form_elements.security.captcha to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.plugins.form_elements.security.captcha',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

Troubleshooting and usage limitations

In combination with other captcha solutions

At the moment, you can’t use both CAPTCHA (fobi.contrib.plugins.form_elements.security.captcha) and ReCAPTCHA (fobi.contrib.plugins.form_elements.security.recaptcha) plugins alongside due to app name collision of the django-simple-captcha and django-recaptcha packages. That limitation is likely to be solved in future in the django-recaptcha package. Until then, you should choose either one or another, but not both on the same time.

Usage

Note, that unlike most of the other form element plugins, default value for the required attribute is True, which makes the Captcha obligatory. Although you could still set it to False, it does not make much sense to do so.

fobi.contrib.plugins.form_elements.security.honeypot

A Honeypot form field plugin. Just another anti-spam technique.

Installation

  1. Add fobi.contrib.plugins.form_elements.security.honeypot to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.plugins.form_elements.security.honeypot',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

fobi.contrib.plugins.form_elements.security.recaptcha

A ReCAPTCHA form field plugin. Makes use of the django-recaptcha.

Installation

Install django-recaptcha
  1. Download django-recaptcha using pip by running:

    pip install django-recaptcha
    
  2. Add captcha to the INSTALLED_APPS in your settings.py.

  3. Run python manage.py syncdb (or python manage.py migrate if you are

managing database migrations via South) to create the required database tables.
Install fobi ReCAPTCHA plugin
  1. Add fobi.contrib.plugins.form_elements.security.recaptcha to the

INSTALLED_APPS in your settings.py.

INSTALLED_APPS = (
    # ...
    'fobi.contrib.plugins.form_elements.security.recaptcha',
    # ...
)
  1. In the terminal type:

    ./manage.py fobi_sync_plugins
    
  2. Assign appropriate permissions to the target users/groups to be using

the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.
  1. Specify the following ReCAPTCHA credentials in your settings.

    - ``RECAPTCHA_PUBLIC_KEY``
    - ``RECAPTCHA_PRIVATE_KEY``
    

Troubleshooting and usage limitations

In combination with other captcha solutions

At the moment, you can’t use both CAPTCHA (fobi.contrib.plugins.form_elements.security.captcha) and ReCAPTCHA (fobi.contrib.plugins.form_elements.security.recaptcha) plugins alongside due to app name collision of the django-simple-captcha and django-recaptcha packages. That limitation is likely to be solved in future in the django-recaptcha package. Until then, you should choose either one or another, but not both on the same time.

If you happen to see errors like “Input error: k: Format of site key was invalid”, make sure to have defined (and filled in properly) the RECAPTCHA_PUBLIC_KEY and RECAPTCHA_PRIVATE_KEY in your settnings.py. See the following thread for more information.

Usage

Note, that unlike most of the other form element plugins, default value for the required attribute is True, which makes the ReCaptcha obligatory. Although you could still set it to False, it does not make much sense to do so.

fobi.contrib.plugins.form_elements.test.dummy

A Fobi Dummy form element plugin. Created for testing purposes.

Installation

  1. Add fobi.contrib.plugins.form_elements.test.dummy to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.plugins.form_elements.test.dummy',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

fobi.contrib.plugins.form_handlers.db_store

A Fobi Database Store form-/wizard- handler plugin. Saves submitted form data into the SavedFormDataEntry/SavedFormWizardDataEntry models.

Dependencies

The xlwt package is required (optional) for XLS export. If not present, export format falls back to CSV.

Installation

  1. Add fobi.contrib.plugins.form_handlers.db_store to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.plugins.form_handlers.db_store',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py migrate
    
    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

  4. Add db_store form handler plugin URLs to the urls.py of your project.

    urlpatterns = [
        # DB Store plugin URLs
        url(r'^fobi/plugins/form-handlers/db-store/',
            include('fobi.contrib.plugins.form_handlers.db_store.urls')),
    ]
    

    For form wizards do:

    urlpatterns = [
        # DB Store plugin URLs
        url(r'^fobi/plugins/form-wizard-handlers/db-store/',
            include('fobi.contrib.plugins.form_handlers.db_store.urls.'
                    'form_wizard_handlers')),
    ]
    

fobi.contrib.plugins.form_handlers.http_repost

A Fobi HTTP Repost form handler plugin. Submits the form data as is to the given endpoint.

Installation

  1. Add fobi.contrib.plugins.form_handlers.http_repost to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.plugins.form_handlers.http_repost',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

fobi.contrib.plugins.form_handlers.mail

A Fobi Mail form handler plugin. Submits the form data by email to the specified email address.

Installation

  1. Add fobi.contrib.plugins.form_handlers.mail to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.plugins.form_handlers.mail',
        # ...
    )
    
  2. In the terminal type:

    ./manage.py fobi_sync_plugins
    
  3. Assign appropriate permissions to the target users/groups to be using the plugin if FOBI_RESTRICT_PLUGIN_ACCESS is set to True.

mailchimp_importer

A django-fobi integration with MailChimp.

This plugin makes it possible to import a form from a MailChimp list. A typical list URL would be this. In the listing you would see list names and Stats at the right corner. If you click on it you would see the Settings link. Follow it and scroll to the bottom for the unique id for your list. Now, if you have been successfully authenticated to the MailChimp API using your API_KEY, you could call the lists.merge_vars method for getting the form. API_KEY could be obtained from the MailChimp in the Account API.

For additional information on MailChimp import see the following article.

Prerequisites

Python wrapper for the Mailchimp:

pip install mailchimp

If you are using Django 1.8 or greater, you would need django-formtools package as well:

pip install django-formtools

Installation

your_project/settings.py
INSTALLED_APPS = list(INSTALLED_APPS)
INSTALLED_APPS += [
    'fobi.contrib.plugins.form_importers.mailchimp_importer',
]

How it works

Assuming that you have configured the mailchimp_importer plugin properly and have the Django running locally on port 8000, accessing the following URL would bring you to the MailChimp form import wizard.

On the first step you would be asked to provide your API_KEY, which is used to authenticate to the MailChimp in order to fetch your list- and form- information. The key isn’t stored/saved/remembered. Next time you want to import a form from the same account, you would have to provide it again.

Development status

This part of code is alpha, which means it experimental and needs improvements.

See the TODOS for the full list of planned-, pending- in-development- or to-be-implemented features.

If you want to improve it or did make it working, please, make a pull request.

fobi.contrib.themes.bootstrap3

A django-fobi Bootstrap 3 theme. Based on the ??? template.

Installation

  1. Add fobi.contrib.themes.bootstrap3 to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.themes.bootstrap3',
        # ...
    )
    
  2. Specify bootstrap3 as a default theme in your settings.py:

    FOBI_DEFAULT_THEME = 'bootstrap3'
    

fobi.contrib.themes.djangocms_admin_style_theme

A django-fobi theme in a style of djangocms-admin-style admin. Relies on djangocms-admin-style package and some jQuery UI only.

jQuery UI “Smoothness” theme comes from here.

Installation

Install djangocms-admin-style

See the original installation instructions.

  1. Install the djangocms-admin-style package.

    pip install djangocms-admin-style
    
  2. Add djangocms_admin_style to your INSTALLED_APPS just before django.contrib.admin.

Install fobi.contrib.themes.djangocms_admin_style_theme theme
  1. Add fobi.contrib.themes.djangocms_admin_style_theme to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.themes.djangocms_admin_style_theme',
        # ...
    )
    
  2. Specify djangocms_admin_style_theme as a default theme in your settings.py:

    FOBI_DEFAULT_THEME = 'djangocms_admin_style_theme'
    

fobi.contrib.themes.foundation5

A django-fobi Foundation 5 theme. Based on the ??? template, but entire JS and CSS are taken from Foundation 5 version 5.4.0. The following icon set was used.

Installation

  1. Add fobi.contrib.themes.foundation5 to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.themes.foundation5',
        # ...
    )
    
  2. Specify foundation5 as a default theme in your settings.py:

    FOBI_DEFAULT_THEME = 'foundation5'
    

fobi.contrib.themes.simple

A django-fobi theme in a style of Django admin. Relies on Django-admin and some jQuery UI only.

jQuery UI “Django” theme comes from here.

Installation

  1. Add fobi.contrib.themes.simple to the INSTALLED_APPS in your settings.py.

    INSTALLED_APPS = (
        # ...
        'fobi.contrib.themes.simple',
        # ...
    )
    
  2. Specify simple as a default theme in your settings.py:

    FOBI_DEFAULT_THEME = 'simple'