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¶
Django 2.2, 3.0, 3.1, 3.2, 4.0 and 4.1.
Python 3.6, 3.7, 3.8, 3.9, 3.10 and 3.11.
Key concepts¶
Each form consists of elements. Form elements are divided into groups:
form fields (input field, textarea, hidden field, file field, etc.).
content (presentational) elements (text, image, embed video, etc.).
security elements (captcha, 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.
Forms can be automatically enabled/disabled based on dates (start date, end date).
Anti-spam solutions like CAPTCHA, ReCAPTCHA, Honeypot or Invisible reCAPTCHA come out of the box (CAPTCHA and ReCAPTCHA do require additional third-party apps to be installed; Invisible reCAPTCHA doesn’t).
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.
Class based views (and class-based permissions). Forms have an owner (
auth.User
). Default permissions are set for the owner, but class-based views provide a lot of freedom and can be easily customized.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 Wagtail (in a form of a Wagtail page).
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:
Implement disabling forms based on dates.
Cloning of forms.
JSON schema support.
Webpack integration.
Improved Django REST framework OPTIONS.
Bootstrap 4 support.
Foundation 6 support.
See the TODOS for the full list of planned-, pending- in-development- or to-be-implemented features.
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:
Admin username: test_admin
Admin password: test
Django admin interface:
Admin username: test_admin
Admin password: test
If quick installer doesn’t work for you, see the manual steps on running the example project.
Quick start¶
See the quick start.
Installation¶
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
Add fobi to
INSTALLED_APPS
of the your projects’ Django settings. Furthermore, all themes and plugins to be used, shall be added to theINSTALLED_APPS
as well. Note, that if a plugin has additional dependencies, you should be mentioning those in theINSTALLED_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', 'fobi.contrib.plugins.form_handlers.mail_sender', # Other project specific apps 'foo', # Test app # ... )
Make appropriate changes to the
TEMPLATES
of the your projects’ Django settings.And
fobi.context_processors.theme
andfobi.context_processors.dynamic_values
. See the following example.TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [(os.path.join('path', 'to', 'your', 'templates'))], 'OPTIONS': { 'context_processors': [ "django.template.context_processors.debug", 'django.template.context_processors.request', "django.contrib.auth.context_processors.auth", "django.contrib.messages.context_processors.messages", "fobi.context_processors.theme", # Important! "fobi.context_processors.dynamic_values", # Optional ], 'loaders': [ 'django.template.loaders.filesystem.Loader', 'django.template.loaders.app_directories.Loader', 'admin_tools.template_loaders.Loader', ], 'debug': DEBUG_TEMPLATE, } }, ]
Make sure that
django.core.context_processors.request
is incontext_processors
too.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 theINSTALLED_APPS
, you should mention the following inurls
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, form_element_entries=None):
"""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
)
Register the plugin
form_handler_plugin_registry.register(SampleMailHandlerPlugin)
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 gettext_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 gettext_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 gettext_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.urls import reverse
from django.contrib import messages
from django.utils.translation import gettext_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',
# ...
)
Class-based views¶
Views¶
Migration to class based views is simple. Only your project’s urls.py
would change:
urlpatterns = [
# ...
url(r'^fobi/', include('fobi.urls.class_based.view')),
url(r'^fobi/', include('fobi.urls.class_based.edit')),
# ...
]
To use function based views, simply replace the previous line with:
urlpatterns = [
# ...
url(r'^fobi/', include('fobi.urls.view')),
url(r'^fobi/', include('fobi.urls.edit')),
# ...
]
Permissions¶
Class-based permissions work only in combination with class-based views.
Example:
from fobi.permissions.definitions import edit_form_entry_permissions
from fobi.permissions.generic import BasePermission
from fobi.permissions.helpers import (
any_permission_required_func, login_required,
)
class EditFormEntryPermission(BasePermission):
"""Permission to edit form entries."""
def has_permission(self, request, view) -> bool:
return login_required(request) and any_permission_required_func(
edit_form_entry_permissions
)(request.user)
def has_object_permission(self, request, view, obj) -> bool:
return login_required(request) and any_permission_required_func(
edit_form_entry_permissions
)(request.user) and obj.user == request.user
And then in your view:
from fobi.views.class_based import EditFormEntryView
class MyEditFormEntryView(EditFormEntryView):
"""EditFormEntryView."""
permission_classes = (EditFormEntryPermission,)
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 gettext_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('© 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.
Mail the sender: Send the form data by email to the sender (submitter) of the form.
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, Mezzanine and Wagtail.
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 gettext_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 gettext_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.
Fields¶
Fields marked with asterisk (*) fall under the definition of text elements. It’s possible to provide Dynamic initial values for text elements.
Content/presentation¶
Content plugins are presentational plugins, that make your forms look more complete and content rich.
Content image: Insert an image.
Content image URL: Insert an image URL.
Content markdown: Add markdown text.
Content richtext: Add rich text (based on django-ckeditor package).
Content text: Add text.
Content video: Add an embed YouTube or Vimeo video.
Security¶
CAPTCHA: CAPTCHA integration, requires
django-simple-captcha
package.ReCAPTCHA: CAPTCHA integration, requires
django-recaptcha
package.Invisible ReCAPTCHA: Google invisible reCAPTCHA integration, with no additional dependencies.
Honeypot: Anti-spam honeypot field.
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.
Mail the sender: Send the form data by email to the sender.
Bundled themes¶
Below a short overview of the themes. See the README.rst file in directory of each theme for details.
Bootstrap 3: Bootstrap 3 theme.
Foundation 5: Foundation 5 theme.
Simple: Basic theme with form editing is in a style of Django admin.
DjangoCMS admin style: Basic theme with form editing is in a style of djangocms-admin-style.
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 exposed 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.
TEMPLATES = [
{
# ...
'OPTIONS': {
# ...
'context_processors': [
# ...
"fobi.context_processors.theme", # Important!
"fobi.context_processors.dynamic_values", # Optional
]
},
},
]
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 many ways to deal with missing plugin errors, but the chosen strategy (which you don’t yet have full control of) is safest (import everything possible, but warn user about errors). 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.
Translations¶
Available translations¶
English is the primary language. The following translations are available (core and plugins)
Overriding translations¶
There might be cases when you want to override certain translations. It’s easily achievable with introduction of custom locale paths in your project.
See the following as a good example of overriding some English plugin labels.
Run the example project as follows:
cd examples/simple/
./manage.py runserver --settings=settings.alternative_labels
In the example given, “Boolean” and “Checkbox select multiple” plugin names are renamed to “Checkbox” and “Multiple checkboxes” respectively.
All built-in plugin name
values are almost equivalent to the plugin uid
values. By default plugins are sorted by uid
value. When you override the
name
of the plugin, sorting breaks. Therefore, it’s recommended to
set the FOBI_SORT_PLUGINS_BY_VALUE
value to True in your settings module.
Default value is False, which means that plugins are sorted by their uid
value.
FOBI_SORT_PLUGINS_BY_VALUE = True
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).
Note
You are recommended to use Postgres or MySQL for testing. Tests occasionally fail on SQLite due to very intensive IO and SQLite table locking.
To test with all supported Python/Django versions type:
tox
To test against specific environment, type:
tox -e py37-django21
To test just your working environment type:
./runtests.py
To run a single test class in a given test module in your working environment type:
./runtests.py src/fobi/tests/test_browser_build_dynamic_forms.py::FobiBrowserBuldDynamicFormsTest -k "test_2004_submit_form"
It’s assumed that you have all the requirements installed. If not, first install the test requirements:
pip install -r examples/requirements/test.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 ChromeDriver¶
Download ChromeDriver version matching your browser. You can always find proper version at chromedriver.chromium.org/downloads:
wget https://chromedriver.storage.googleapis.com/87.0.4280.88/chromedriver_linux64.zip unzip chromedriver_linux64.zip sudo mv chromedriver /usr/bin/chromedriver87 sudo chown root:root /usr/bin/chromedriver87 sudo chmod +x /usr/bin/chromedriver87
Specify the full path to your ChromeDriver in
CHROME_DRIVER_EXECUTABLE_PATH
setting. Example:CHROME_DRIVER_EXECUTABLE_PATH = '/usr/bin/chromedriver87'
After that your Selenium tests would work.
Set up Firefox 47¶
Download Firefox 47 from this location and unzip it into
/usr/lib/firefox47/
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¶
Install
xvfb
package which is used to start Firefox in headless mode.sudo apt-get install xvfb
Run the tests using headless Firefox.
./scripts/runtests.sh
Or run tox tests using headless Firefox.
./scripts/tox.sh
Or run specific tox tests using headless Firefox.
./scripts/tox.sh -e py36-django111
Setup PhantomJS¶
You could also run tests in headless mode (faster). For that you will need PhantomJS.
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
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-only OR LGPL-2.1-or-later
Support¶
For any security issues contact me at the e-mail given in the Author section. For overall issues, go to GitHub.
Author¶
Artur Barseghyan <artur.barseghyan@gmail.com>
Screenshots¶
Bootstrap3 theme¶
View/edit form¶
Form elements¶
- 1.3
Edit form - form elements tab active, no elements yet

- 1.4
Edit form - form elements tab active, add a form element menu

- 1.5
Edit form - add a form element (URL plugin)

- 1.6
Edit form - form elements tab active, with form elements

Form handlers¶
- 1.7
Edit form - form handlers tab active, no handlers yet

- 1.8
Edit form - form handlers tab tactive, add form handler menu

- 1.9
Edit form - add a form handler (Mail plugin)

- 1.10
Edit form - form handlers tab active, with form handlers

- 1.11
Edit form - form properties tab active

- 1.12
View form

- 1.13
View form - form submitted (thanks page)

- 1.14
Edit form - add a form element (Video plugin)

- 1.15
Edit form - add a form element (Boolean plugin)

- 1.16
Edit form

- 1.17
View form

Simple theme¶
View/edit form¶
- 2.1
Edit form - form elements tab active, with form elements

- 2.2
Edit form - form elements tab active, add a form element menu

- 2.3
Edit form - add a form element (Hidden plugin)

- 2.4
Edit form - form handlers tab active, with form handlers

- 2.5
Edit form - form properties tab active

- 2.6
View form

(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¶
Versions¶
See the requirements files:
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:
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_richtext
content_text
content_video
Fields¶
boolean
checkbox_select_multiple
date
date_drop_down
datetime
decimal
duration
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.duration
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_richtext
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.duration
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_richtext
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.duration',
'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_richtext',
'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¶
Add
fobi.contrib.apps.drf_integration.form_elements.content.content_image
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.apps.drf_integration.form_elements.content.content_image', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
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” forContentImage
field.content
(str): Representation of the content. Rendered partial HTML.raw
(json dict): Raw attributes of theContentImage
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¶
Add
fobi.contrib.apps.drf_integration.form_elements.content.content_image_url
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.apps.drf_integration.form_elements.content.content_image_url', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
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” forContentImageURL
field.content
(str): Representation of the content. Rendered partial HTML.raw
(json dict): Raw attributes of theContentImageURL
plugin. Contains “url”, “alt”, “fit_method” and “size” attributes.
fobi.contrib.apps.drf_integration.form_elements.content.content_markdown¶
A django-fobi
ContentMarkdown plugin for integration with
Django REST framework
. Makes use of the
fobi.contrib.apps.drf_integration.fields.ContentMarkdown
.
Installation¶
Add
fobi.contrib.apps.drf_integration.form_elements.content.content_markdown
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.apps.drf_integration.form_elements.content.content_markdown', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
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, ContentMarkdown
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_markdown_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” forContentText
field.content
(str): Representation of the content. Rendered partial HTML.raw
(json dict): Raw attributes of theContentText
plugin. Contains “text” attribute.
fobi.contrib.apps.drf_integration.form_elements.content.content_richtext¶
A django-fobi
ContentRichText plugin for integration with
Django REST framework
. Makes use of the
fobi.contrib.apps.drf_integration.fields.ContentRichText
.
Installation¶
Add
fobi.contrib.apps.drf_integration.form_elements.content.content_richtext
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.apps.drf_integration.form_elements.content.content_richtext', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
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” forContentText
field.content
(str): Representation of the content. Rendered partial HTML.raw
(json dict): Raw attributes of theContentText
plugin. Contains “text” attribute.
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¶
Add
fobi.contrib.apps.drf_integration.form_elements.content.content_text
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.apps.drf_integration.form_elements.content.content_text', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
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” forContentText
field.content
(str): Representation of the content. Rendered partial HTML.raw
(json dict): Raw attributes of theContentText
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¶
Add
fobi.contrib.apps.drf_integration.form_elements.content.content_video
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.apps.drf_integration.form_elements.content.content_video', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
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” forContentVideo
field.content
(str): Representation of the content. Rendered partial HTML.raw
(json dict): Raw attributes of theContentVideo
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¶
Add
fobi.contrib.apps.drf_integration.form_elements.fields.boolean
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.apps.drf_integration.form_elements.fields.boolean', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
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¶
Add
fobi.contrib.apps.drf_integration.form_elements.fields.checkbox_select_multiple
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.apps.drf_integration.form_elements.fields.checkbox_select_multiple', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
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¶
Add
fobi.contrib.apps.drf_integration.form_elements.fields.date
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.apps.drf_integration.form_elements.fields.date', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
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¶
Add
fobi.contrib.apps.drf_integration.form_elements.fields.date_drop_down
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.apps.drf_integration.form_elements.fields.date_drop_down', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
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¶
Add
fobi.contrib.apps.drf_integration.form_elements.fields.datetime
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.apps.drf_integration.form_elements.fields.datetime', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
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¶
Add
fobi.contrib.apps.drf_integration.form_elements.fields.decimal
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.apps.drf_integration.form_elements.fields.decimal', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
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.duration¶
A django-fobi
DurationField plugin for integration with
Django REST framework
. Makes use of the
rest_framework.fields.DurationField
.
Installation¶
Add
fobi.contrib.apps.drf_integration.form_elements.fields.duration
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.apps.drf_integration.form_elements.fields.duration', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
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¶
Add
fobi.contrib.apps.drf_integration.form_elements.fields.email
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.apps.drf_integration.form_elements.fields.email', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
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¶
Add
fobi.contrib.apps.drf_integration.form_elements.fields.file
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.apps.drf_integration.form_elements.fields.file', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
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¶
Add
fobi.contrib.apps.drf_integration.form_elements.fields.float
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.apps.drf_integration.form_elements.fields.float', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
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¶
Add
fobi.contrib.apps.drf_integration.form_elements.fields.input
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.apps.drf_integration.form_elements.fields.input', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
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¶
Add
fobi.contrib.apps.drf_integration.form_elements.fields.integer
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.apps.drf_integration.form_elements.fields.integer', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
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¶
Add
fobi.contrib.apps.drf_integration.form_elements.fields.ip_address
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.apps.drf_integration.form_elements.fields.ip_address', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
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¶
Add
fobi.contrib.apps.drf_integration.form_elements.fields.null_boolean
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.apps.drf_integration.form_elements.fields.null_boolean', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
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¶
Add
fobi.contrib.apps.drf_integration.form_elements.fields.password
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.apps.drf_integration.form_elements.fields.password', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
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¶
Add
fobi.contrib.apps.drf_integration.form_elements.fields.radio
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.apps.drf_integration.form_elements.fields.radio', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
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¶
Add
fobi.contrib.apps.drf_integration.form_elements.fields.range_select
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.apps.drf_integration.form_elements.fields.range_select', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
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¶
Add
fobi.contrib.apps.drf_integration.form_elements.fields.regex
to theINSTALLED_APPS
in yoursettings.py
.
INSTALLED_APPS = (
# ...
'fobi.contrib.apps.drf_integration.form_elements.fields.regex',
# ...
)
In the terminal type:
./manage.py fobi_sync_plugins
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¶
Add
fobi.contrib.apps.drf_integration.form_elements.fields.select
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.apps.drf_integration.form_elements.fields.select', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
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_model_object¶
A django-fobi
ModelChoiceField plugin for integration with
Django REST framework
. Makes use of the
fobi.contrib.apps.drf_integration.fields.py.ModelChoiceField
.
Installation¶
Add
fobi.contrib.apps.drf_integration.form_elements.fields.select_model_object
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.apps.drf_integration.form_elements.fields.select_model_object', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
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¶
Add
fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
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_model_objects¶
A django-fobi
MultipleModelChoiceField plugin for integration with
Django REST framework
. Makes use of the
fobi.contrib.apps.drf_integration.fields.py.MultipleModelChoiceField
.
Installation¶
Add
fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple_model_objects
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple_model_objects', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
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¶
Add
fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
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¶
Add
fobi.contrib.apps.drf_integration.form_elements.fields.slider
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.apps.drf_integration.form_elements.fields.slider', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
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¶
Add
fobi.contrib.apps.drf_integration.form_elements.fields.slug
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.apps.drf_integration.form_elements.fields.slug', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
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¶
Add
fobi.contrib.apps.drf_integration.form_elements.fields.text
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.apps.drf_integration.form_elements.fields.text', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
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¶
Add
fobi.contrib.apps.drf_integration.form_elements.fields.textarea
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.apps.drf_integration.form_elements.fields.textarea', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
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¶
Add
fobi.contrib.apps.drf_integration.form_elements.fields.time
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.apps.drf_integration.form_elements.fields.time', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
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¶
Add
fobi.contrib.apps.drf_integration.form_elements.fields.time
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.apps.drf_integration.form_elements.fields.url', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
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¶
Add
fobi.contrib.apps.drf_integration.form_handlers.db_store
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.apps.drf_integration.form_handlers.db_store', # ... )
In the terminal type:
./manage.py migrate ./manage.py fobi_sync_plugins
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¶
Add
fobi.contrib.apps.drf_integration.form_handlers.http_respost
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.apps.drf_integration.form_handlers.http_repost', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
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¶
Add
fobi.contrib.apps.drf_integration.form_handlers.mail
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.apps.drf_integration.form_handlers.mail', # ... )
In the terminal type:
./manage.py migrate ./manage.py fobi_sync_plugins
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_sender¶
A django-fobi
Mail the sender form handler plugin for integration
with Django REST framework
. Submits the form data by email to the
specified email address.
Installation¶
Add
fobi.contrib.apps.drf_integration.form_handlers.mail_sender
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.apps.drf_integration.form_handlers.mail_sender', # ... )
In the terminal type:
./manage.py migrate ./manage.py fobi_sync_plugins
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¶
Versions¶
See the requirements files:
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¶
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¶
If you use the mezzanine example project, to start go to the http://localhost:8003/fobi/ URL and create a form.
Then go to http://localhost:8003/admin/pages/page/ and add a new Fobi form page.
Choose the form and optionally - override the form settings and then save the page.
See the page in the front-end.
fobi.contrib.apps.wagtail_integration¶
A django-fobi
integration with Wagtail.
Prerequisites¶
Tested with Wagtail 1.10.1 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 += [
# ... standard wagtail apps
# ... standard django-fobi apps
'fobi.contrib.apps.wagtail_integration', # Wagtail integration app
]
your_project/your_app/models.py¶
If existing fobi.contrib.apps.wagtail_integration.models.FobiFormPage
model does not fit your needs and you want to extend, there’s a
fobi.contrib.apps.wagtail_integration.abstract.AbstractFobiFormPage
abstract model which you can extend. If so, remove the
fobi.contrib.apps.wagtail_integration
from INSTALLED_APPS
and add
path to the app with your customised FobiFormPage
model.
from fobi.contrib.apps.wagtail_integration.models import AbstractFobiFormPage
class FobiFormPage(AbstractFobiFormPage):
"""Fobi form page."""
# ... customise your form page further
And then:
INSTALLED_APPS = [
# ... standard wagtail apps
# ... standard django-fobi apps
'your_app', # Customised `FobiFormPage` model app
]
Information for developers¶
Template rendering¶
The embed Wagtail 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 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_WAGTAIL_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_WAGTAIL_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': {
'wagtail_integration': {
'form_template_choices': [
('fobi/bootstrap3_extras/view_embed_form.html',
"Custom form view (non-partial) template"),
],
'success_page_template_choices': [
('fobi/bootstrap3_extras/embed_form_submitted.html',
"Custom form entry submitted (non-partial) template"),
],
},
},
'foundation5': {
'wagtail_integration': {
'form_template_choices': [
('fobi/foundation5_extras/view_embed_form.html',
"Custom form view (non-partial) template"),
],
'success_page_template_choices': [
('fobi/foundation5_extras/embed_form_submitted.html',
"Custom form entry submitted (non-partial) template"),
],
},
},
}
Disregard the name, both view_embed_form.html
and
embed_form_submitted.html
files should be full (non-partial) HTML
templates.
Usage¶
The fobi.contrib.apps.wagtail_integration.models.FobiFormPage
consists
of the following django-fobi specific fields (as well as of other Wagtail
Page related 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.
Form elements¶
fobi.contrib.plugins.form_elements.content.content_image¶
A Fobi
Image form element plugin.
Installation¶
Add
fobi.contrib.plugins.form_elements.content.content_image
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'easy_thumbnails', 'fobi.contrib.plugins.form_elements.content.content_image', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
Assign appropriate permissions to the target users/groups to be using the plugin if
FOBI_RESTRICT_PLUGIN_ACCESS
is set to True.Additionally, for the fine tuning, see the
fobi.contrib.plugins.form_elements.content.content_image.defaults
module. If necessary, override the settings by prependingFOBI_PLUGIN_CONTENT_IMAGE_
to the desired variable name from the above mentioneddefaults
module.
fobi.contrib.plugins.form_elements.content.content_image_url¶
A Fobi
ImageURL form element plugin.
Installation¶
Add
fobi.contrib.plugins.form_elements.content.content_image_url
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.plugins.form_elements.content.content_image_url', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
Assign appropriate permissions to the target users/groups to be using the plugin if
FOBI_RESTRICT_PLUGIN_ACCESS
is set to True.Additionally, for the fine tuning, see the
fobi.contrib.plugins.form_elements.content.content_image_url.defaults
module. If necessary, override the settings by prependingFOBI_PLUGIN_CONTENT_IMAGE_URL_
to the desired variable name from the above mentioneddefaults
module.
fobi.contrib.plugins.form_elements.content.content_markdown¶
A Fobi
Markdown form element plugin based on
remarkable and
markdown.
Installation¶
Install
markdown
.pip install markdown
Add
fobi.reusable.markdown_widget
toINSTALLED_APPS
insettings.py
.INSTALLED_APPS = ( ... 'fobi.reusable.markdown_widget', ... )
Add
fobi.contrib.plugins.form_elements.content.content_markdown
toINSTALLED_APPS
insettings.py
.INSTALLED_APPS = ( ... 'fobi.contrib.plugins.form_elements.content.content_markdown', ... )
In the terminal type:
./manage.py fobi_sync_plugins
Assign appropriate permissions to the target users/groups to be using the plugin if
FOBI_RESTRICT_PLUGIN_ACCESS
is set toTrue
.
fobi.contrib.plugins.form_elements.content.content_richtext¶
A Fobi
Rich text form element plugin based on
CKEditor and
django-ckeditor.
Installation¶
Install
django-ckeditor
.pip install django-ckeditor
Add
ckeditor
toINSTALLED_APPS
insettings.py
.INSTALLED_APPS = ( ... 'ckeditor', ... )
Add
fobi.contrib.plugins.form_elements.content.content_richtext
toINSTALLED_APPS
insettings.py
.INSTALLED_APPS = ( ... 'fobi.contrib.plugins.form_elements.content.content_richtext', ... )
Add
fobi.contrib.themes.bootstrap3.widgets.form_elements.content_richtext_bootstrap3_widget
toINSTALLED_APPS
insettings.py
(if you’re usingbootstrap3
theme). If you’re using another theme, add correspondent widget specific to the active theme.INSTALLED_APPS = ( ... 'fobi.contrib.themes.bootstrap3.widgets.form_elements.content_richtext_bootstrap3_widget', ... )
In the terminal type:
./manage.py fobi_sync_plugins
Assign appropriate permissions to the target users/groups to be using the plugin if
FOBI_RESTRICT_PLUGIN_ACCESS
is set toTrue
.
Controlling HTML tags and attributes¶
Install
bleach
.pip install bleach
Specify
FOBI_PLUGIN_CONTENT_RICHTEXT_ALLOWED_TAGS
,FOBI_PLUGIN_CONTENT_RICHTEXT_ALLOWED_ATTRIBUTES
andFOBI_PLUGIN_CONTENT_RICHTEXT_ALLOWED_STYLES
insettings.py
. The default values come from bleach:FOBI_PLUGIN_CONTENT_RICHTEXT_ALLOWED_TAGS = [ 'a', 'abbr', 'acronym', 'b', 'blockquote', 'code', 'em', 'i', 'li', 'ol', 'strong', 'ul', ] FOBI_PLUGIN_CONTENT_RICHTEXT_ALLOWED_ATTRIBUTES = { 'a': ['href', 'title'], 'abbr': ['title'], 'acronym': ['title'], } FOBI_PLUGIN_CONTENT_RICHTEXT_ALLOWED_STYLES = []
fobi.contrib.plugins.form_elements.content.content_text¶
A Fobi
Text form element plugin.
Installation¶
Add
fobi.contrib.plugins.form_elements.content.content_text
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.plugins.form_elements.content.content_text', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
Assign appropriate permissions to the target users/groups to be using the plugin if
FOBI_RESTRICT_PLUGIN_ACCESS
is set to True.Additionally, for the fine tuning, see the
fobi.contrib.plugins.form_elements.content.content_text.defaults
module. If necessary, override the settings by prependingFOBI_PLUGIN_CONTENT_TEXT_
to the desired variable name from the above mentioneddefaults
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¶
Add
fobi.contrib.plugins.form_elements.content.content_video
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.plugins.form_elements.content.content_video', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
Assign appropriate permissions to the target users/groups to be using the plugin if
FOBI_RESTRICT_PLUGIN_ACCESS
is set to True.Additionally, for the fine tuning, see the
fobi.contrib.plugins.form_elements.content.content_video.defaults
module. If necessary, override the settings by prependingFOBI_PLUGIN_CONTENT_VIDEO_
to the desired variable name from the above mentioneddefaults
module.
fobi.contrib.plugins.form_elements.fields.boolean¶
A Fobi
Boolean form field plugin. Makes use of the
django.forms.fields.BooleanField
.
Installation¶
Add
fobi.contrib.plugins.form_elements.fields.boolean
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.plugins.form_elements.fields.boolean', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
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¶
Add
fobi.contrib.plugins.form_elements.fields.checkbox_select_multiple
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.plugins.form_elements.fields.checkbox_select_multiple', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
Assign appropriate permissions to the target users/groups to be using the plugin if
FOBI_RESTRICT_PLUGIN_ACCESS
is set to True.By default, the submitted form value of checkbox_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¶
Add
fobi.contrib.plugins.form_elements.fields.date
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.plugins.form_elements.fields.date', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
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¶
Add
fobi.contrib.plugins.form_elements.fields.date_drop_down
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.plugins.form_elements.fields.date_drop_down', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
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¶
Add
fobi.contrib.plugins.form_elements.fields.datetime
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.plugins.form_elements.fields.datetime', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
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¶
Add
fobi.contrib.plugins.form_elements.fields.decimal
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.plugins.form_elements.fields.decimal', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
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¶
Add
fobi.contrib.plugins.form_elements.fields.duration
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.plugins.form_elements.fields.duration', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
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.email¶
A Fobi
Email form field plugin. Makes use of the
django.forms.fields.EmailField
and django.forms.widgets.TextInput
.
Installation¶
Add
fobi.contrib.plugins.form_elements.fields.email
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.plugins.form_elements.fields.email', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
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¶
Add
fobi.contrib.plugins.form_elements.fields.file
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.plugins.form_elements.fields.file', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
Assign appropriate permissions to the target users/groups to be using the plugin if
FOBI_RESTRICT_PLUGIN_ACCESS
is set to True.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.You may optionally restrict uploaded files extensions by specifying the
allowed_extensions
field in the plugin.
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¶
Add
fobi.contrib.plugins.form_elements.fields.float
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.plugins.form_elements.fields.float', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
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¶
Add
fobi.contrib.plugins.form_elements.fields.input
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.plugins.form_elements.fields.input', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
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¶
Add
fobi.contrib.plugins.form_elements.fields.integer
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.plugins.form_elements.fields.integer', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
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¶
Add
fobi.contrib.plugins.form_elements.fields.ip_address
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.plugins.form_elements.fields.ip_address', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
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¶
Add
fobi.contrib.plugins.form_elements.fields.null_boolean
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.plugins.form_elements.fields.null_boolean', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
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¶
Add
fobi.contrib.plugins.form_elements.fields.password
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.plugins.form_elements.fields.password', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
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¶
Add
fobi.contrib.plugins.form_elements.fields.radio
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.plugins.form_elements.fields.radio', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
Assign appropriate permissions to the target users/groups to be using the plugin if
FOBI_RESTRICT_PLUGIN_ACCESS
is set to True.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¶
Add
fobi.contrib.plugins.form_elements.fields.range_select
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.plugins.form_elements.fields.range_select', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
Assign appropriate permissions to the target users/groups to be using the plugin if
FOBI_RESTRICT_PLUGIN_ACCESS
is set to True.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
By default, the submitted form value of range_select 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_RANGE_SELECT_SUBMIT_VALUE_AS
assign one of the following values: “val”, “repr” or “mix” to get the desired behaviour.
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¶
Add
fobi.contrib.plugins.form_elements.fields.regex
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.plugins.form_elements.fields.regex', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
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.select¶
A Fobi
Select form field plugin. Makes use of the
django.forms.fields.ChoiceField
and django.forms.widgets.Select
.
Installation¶
Add
fobi.contrib.plugins.form_elements.fields.select
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.plugins.form_elements.fields.select', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
Assign appropriate permissions to the target users/groups to be using the plugin if
FOBI_RESTRICT_PLUGIN_ACCESS
is set to True.By default, the submitted form value of select 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_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_model_object¶
A Fobi
Select Model Object form field plugin. Makes use of the
django.forms.models.ModelChoiceField
and django.forms.widgets.Select
.
Installation¶
Add
fobi.contrib.plugins.form_elements.fields.select_model_object
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.plugins.form_elements.fields.select_model_object', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
Assign appropriate permissions to the target users/groups to be using the plugin if
FOBI_RESTRICT_PLUGIN_ACCESS
is set to True.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', ]
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.
Download
django-mptt
using pip by running:
pip install django-mptt
Add
mptt
to theINSTALLED_APPS
in yoursettings.py
.
Install select_mptt_model_object plugin¶
Add
mptt
andfobi.contrib.plugins.form_elements.fields.select_mptt_model_object
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'mptt', 'fobi.contrib.plugins.form_elements.fields.select_mptt_model_object', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
Assign appropriate permissions to the target users/groups to be using the plugin if
FOBI_RESTRICT_PLUGIN_ACCESS
is set to True.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', ]
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¶
Add
fobi.contrib.plugins.form_elements.fields.select_multiple
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.plugins.form_elements.fields.select_multiple', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
Assign appropriate permissions to the target users/groups to be using the plugin if
FOBI_RESTRICT_PLUGIN_ACCESS
is set to True.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¶
Add
fobi.contrib.plugins.form_elements.fields.select_multiple_model_objects
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.plugins.form_elements.fields.select_multiple_model_objects', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
Assign appropriate permissions to the target users/groups to be using the plugin if
FOBI_RESTRICT_PLUGIN_ACCESS
is set to True.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', ]
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.
Download
django-mptt
using pip by running:
pip install django-mptt
Add
mptt
to theINSTALLED_APPS
in yoursettings.py
.
Install select_multiple_mptt_model_objects plugin¶
Add
fobi.contrib.plugins.form_elements.fields.select_multiple_mptt_model_objects
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'mptt', 'fobi.contrib.plugins.form_elements.fields.select_multiple_mptt_model_objects', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
Assign appropriate permissions to the target users/groups to be using the plugin if
FOBI_RESTRICT_PLUGIN_ACCESS
is set to True.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', ]
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¶
Add
fobi.contrib.plugins.form_elements.fields.select_multiple_with_max
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.plugins.form_elements.fields.select_multiple_with_max', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
Assign appropriate permissions to the target users/groups to be using the plugin if
FOBI_RESTRICT_PLUGIN_ACCESS
is set to True.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¶
Add
fobi.contrib.plugins.form_elements.fields.slider
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.plugins.form_elements.fields.slider', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
Assign appropriate permissions to the target users/groups to be using the plugin if
FOBI_RESTRICT_PLUGIN_ACCESS
is set to True.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
By default, the submitted form value of slider 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_SLIDER_SUBMIT_VALUE_AS
assign one of the following values: “val”, “repr” or “mix” to get the desired behaviour.
fobi.contrib.plugins.form_elements.fields.slug¶
A Fobi
Text form field plugin. Makes use of the
django.forms.fields.SlugField
and django.forms.widgets.TextInput
.
Installation¶
Add
fobi.contrib.plugins.form_elements.fields.slug
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.plugins.form_elements.fields.slug', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
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.text¶
A Fobi
Text form field plugin. Makes use of the
django.forms.fields.CharField
and django.forms.widgets.TextInput
.
Installation¶
Add
fobi.contrib.plugins.form_elements.fields.text
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.plugins.form_elements.fields.text', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
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¶
Add
fobi.contrib.plugins.form_elements.fields.textarea
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.plugins.form_elements.fields.textarea', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
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¶
Add
fobi.contrib.plugins.form_elements.fields.time
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.plugins.form_elements.fields.time', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
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¶
Add
fobi.contrib.plugins.form_elements.fields.url
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.plugins.form_elements.fields.url', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
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-simple-captcha
won’t work.
sudo apt-get install libfreetype6-dev
Installation¶
Install django-simple-captcha¶
Taken from django-simple-captcha installation instructions.
Download
django-simple-captcha
using pip by running:pip install django-simple-captcha
Add
captcha
to theINSTALLED_APPS
in yoursettings.py
.Run
python manage.py migrate
.Add an entry to your
urls.py
:urlpatterns += [ url(r'^captcha/', include('captcha.urls')), ]
Install fobi Captcha plugin¶
Add
fobi.contrib.plugins.form_elements.security.captcha
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.plugins.form_elements.security.captcha', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
Assign appropriate permissions to the target users/groups to be using the plugin if
FOBI_RESTRICT_PLUGIN_ACCESS
is set to True.In order to have nicer text input widget, add the following line to your settings (if you’re using bootstrap3 theme):
CAPTCHA_TEXT_FIELD_TEMPLATE = 'bootstrap3/captcha/text_field.html'
For foundation5 theme add the following line:
CAPTCHA_TEXT_FIELD_TEMPLATE = 'foundation5/captcha/text_field.html'
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.
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¶
Add
fobi.contrib.plugins.form_elements.security.honeypot
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.plugins.form_elements.security.honeypot', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
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.invisible_recaptcha¶
A Invisible reCAPTCHA form field plugin. Just another anti-spam technique.
Installation¶
Add
fobi.contrib.plugins.form_elements.security.invisible_recaptcha
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.plugins.form_elements.security.invisible_recaptcha', 'fobi.contrib.themes.bootstrap3.widgets.form_elements.invisible_recaptcha_bootstrap3_widget', # ... )
Enable Invisible reCAPTCHA for your site and put the site key and site secret keys in the settings:
FOBI_PLUGIN_INVISIBLE_RECAPTCHA_SITE_KEY = 'your-site-key' FOBI_PLUGIN_INVISIBLE_RECAPTCHA_SITE_SECRET = 'your-site-secret'
In the terminal type:
./manage.py fobi_sync_plugins
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¶
Download
django-recaptcha
using pip by running:
pip install django-recaptcha
Add
captcha
to theINSTALLED_APPS
in yoursettings.py
.Run
python manage.py migrate
.
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',
# ...
)
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.
Specify the following ReCAPTCHA credentials in your settings:
- ``RECAPTCHA_PUBLIC_KEY``
- ``RECAPTCHA_PRIVATE_KEY``
For testing purposes obtain the keys here:
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.
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 settings.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¶
Add
fobi.contrib.plugins.form_elements.test.dummy
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.plugins.form_elements.test.dummy', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
Assign appropriate permissions to the target users/groups to be using the plugin if
FOBI_RESTRICT_PLUGIN_ACCESS
is set to True.
Form handlers¶
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¶
Add
fobi.contrib.plugins.form_handlers.db_store
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.plugins.form_handlers.db_store', # ... )
In the terminal type:
./manage.py migrate ./manage.py fobi_sync_plugins
Assign appropriate permissions to the target users/groups to be using the plugin if
FOBI_RESTRICT_PLUGIN_ACCESS
is set to True.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¶
Add
fobi.contrib.plugins.form_handlers.http_repost
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.plugins.form_handlers.http_repost', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
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¶
Add
fobi.contrib.plugins.form_handlers.mail
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.plugins.form_handlers.mail', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
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_sender¶
A Fobi
Mail form handler plugin. Submits the form
data by email to the sender (submitter) of the form.
Installation¶
Add
fobi.contrib.plugins.form_handlers.mail_sender
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.plugins.form_handlers.mail_sender', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
Assign appropriate permissions to the target users/groups to be using the plugin if
FOBI_RESTRICT_PLUGIN_ACCESS
is set to True.
Usage¶
Add the Mail the sender form handler to the form.
In the value for Form field name to email fill in the form field name which shall be used for sending an email to. For instance, if your original form consisted of name, email, comment fields, you should put email as a value for Form field name to email field.
Form importers¶
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.
Themes¶
fobi.contrib.themes.bootstrap3¶
A django-fobi
Bootstrap 3 theme. Based on the ??? template.
Installation¶
Add
fobi.contrib.themes.bootstrap3
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.themes.bootstrap3', # ... )
Specify
bootstrap3
as a default theme in yoursettings.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.
Install the
djangocms-admin-style
package.pip install djangocms-admin-style
Add
djangocms_admin_style
to yourINSTALLED_APPS
just beforedjango.contrib.admin
.
Install fobi.contrib.themes.djangocms_admin_style_theme theme¶
Add
fobi.contrib.themes.djangocms_admin_style_theme
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.themes.djangocms_admin_style_theme', # ... )
Specify
djangocms_admin_style_theme
as a default theme in yoursettings.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¶
Add
fobi.contrib.themes.foundation5
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.themes.foundation5', # ... )
Specify
foundation5
as a default theme in yoursettings.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¶
Add
fobi.contrib.themes.simple
to theINSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.themes.simple', # ... )
Specify
simple
as a default theme in yoursettings.py
:FOBI_DEFAULT_THEME = 'simple'
fobi.integration¶
Sub-package for easy integration of fobi with third-party apps (especially content management systems).
Concepts¶
Templates¶
Reusable¶
Home for reusable apps that live in fobi codebase, but might be migrated elsewhere some day.
Markdown widget¶
Markdown widget for Django based on remarkable.
fobi.wizard¶
Persistent and working form-wizards.
Documentation¶
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.
The core.
'fobi',
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',
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',
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_image_url',
'fobi.contrib.plugins.form_elements.content.content_text',
'fobi.contrib.plugins.form_elements.content.content_video',
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',
'fobi.contrib.plugins.form_handlers.mail_sender',
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_image_url',
'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',
'fobi.contrib.plugins.form_handlers.mail_sender',
# ...
)
TEMPLATE_CONTEXT_PROCESSORS¶
Add django.core.context_processors.request
and
fobi.context_processors.theme
to TEMPLATES
of
your settings
module.
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [(os.path.join('path', 'to', 'your', 'templates'))],
'OPTIONS': {
'context_processors': [
"django.template.context_processors.debug",
'django.template.context_processors.request',
"django.contrib.auth.context_processors.auth",
"django.contrib.messages.context_processors.messages",
"fobi.context_processors.theme", # Important!
"fobi.context_processors.dynamic_values", # Optional
],
'loaders': [
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
'admin_tools.template_loaders.Loader',
],
'debug': DEBUG_TEMPLATE,
}
},
]
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¶
First you should migrate the database. Depending on your Django version and migration app, this step may vary. Typically as follows:
./manage.py migrate --fake-initial
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.19.6¶
2022-11-28
Tested against Python 3.10 and 3.11. Note that ATM, Python 3.11 tests do pass on SQLite only due to Python 3.11 issue with postgres bindings.
Tested against Django 4.1.
Drop Python 3.5 support.
0.19.3¶
2022-08-08
Minor fixes in the rich_text plugin (bleach related).
Minor fixes and clean up in docs.
0.19.2¶
2022-07-14
Make it easier to get initial data for the ViewFormEntry view.
Apply black and isort on entire code base.
0.19¶
2022-07-11
Introduce class based views. Function based views are still supported and will be supported until at least 0.23.
Migration to class based views is simple. Only your project’s
urls.py
would change:urlpatterns = [ # ... url(r'^fobi/', include('fobi.urls.class_based.view')), url(r'^fobi/', include('fobi.urls.class_based.edit')), # ... ]
To use function based views, simply replace the previous line with:
urlpatterns = [ # ... url(r'^fobi/', include('fobi.urls.view')), url(r'^fobi/', include('fobi.urls.edit')), # ... ]
Class-based permissions (work only in combination with class-based views).
Example:
from fobi.permissions.definitions import edit_form_entry_permissions from fobi.permissions.generic import BasePermission from fobi.permissions.helpers import ( any_permission_required_func, login_required, ) class EditFormEntryPermission(BasePermission): """Permission to edit form entries.""" def has_permission(self, request, view) -> bool: return login_required(request) and any_permission_required_func( edit_form_entry_permissions )(request.user) def has_object_permission(self, request, view, obj) -> bool: return login_required(request) and any_permission_required_func( edit_form_entry_permissions )(request.user) and obj.user == request.user
0.18¶
2022-06-23
Tested against Python 3.9, Django 3.2 and 4.0.
Note
Release dedicated to my dear son, Tigran, who turned 10 recently.
0.17.1¶
2021-01-25
Note
Release dedicated to defenders of Armenia and Artsakh (Nagorno Karabakh) and all the victims of Turkish and Azerbaijani aggression.
Replace outdated simplejson with json.
0.17¶
2020-12-28
Note
Release dedicated to defenders of Armenia and Artsakh (Nagorno Karabakh) and all the victims of Turkish and Azerbaijani aggression.
Deprecate support for the following Django versions: 1.11, 2.0 and 2.1.
0.16.4¶
2020-04-08
Replace admin_static templatetag module with static, since the latter is available in Django 1.11, which is now the minimal supported version.
0.16¶
2020-01-11
Note
This release drops support for Python 2.7 and 3.4 and sets the minimum requirement version for Django to 1.11. If you don’t meet these requirements - do not upgrade.
Add support for Django 3.0.
Drop support Django 1.8, 1.9, 1.10. Minimal supported Django version is 1.11.
Tested against Python 3.8.
Drop Python 2.7 support.
Drop Python 3.4 support.
Tested with Django REST Framework 3.11.x. All older versions of Django REST Framework should still work, although they are no longer tested.
Tested with FeinCMS 1.17.x. No code changes at all. All older versions of FeinCMS should still work, although they are no longer tested.
0.15¶
2019-06-20
Note
Although this release does not contain major backwards incompatible changes, some things you have had working in past might break.
The following settings
FOBI_FAIL_ON_ERRORS_IN_FORM_ELEMENT_PLUGINS
,FOBI_FAIL_ON_ERRORS_IN_FORM_HANDLER_PLUGINS
,FOBI_FAIL_ON_MISSING_INTEGRATION_FORM_ELEMENT_PLUGINS
andFOBI_FAIL_ON_MISSING_INTEGRATION_FORM_HANDLER_PLUGINS
used to be set toFalse
by default (silencing exceptions). It’s no longer so. Exceptions will cause errors from now on (you might get error 500). If you want old behaviour, set them toFalse
.
0.14¶
2019-05-24
Tested again Django 2.2 and Python 3.7.
Use ChromeDriver (for browser tests).
Wiping out (as stated many versions ago) support for Django < 1.8.
Reactivate travis (although not all tests yet pass, while they do pass locally; to be solved in future).
0.13.9¶
2019-02-28
Note
Release supported by Goldmund, Wyldebeast & Wunderliebe.
Add mail_sender form handler plugin.
Upgrade test suite.
0.13.8¶
2019-01-07
Note
Release supported by Goldmund, Wyldebeast & Wunderliebe.
Make it easier to redirect to a new URL (on success) in integration apps.
0.13.6¶
2018-08-16
Completely wiping out
django-autoslug
in requirements (for now it has been replaced withdjango-autoslug-iplweb
).
0.13.2¶
2018-03-12
Choices are now required fields for checkbox_select_multiple, radio, select, select_multiple and select_multiple_with_max form elements.
The active_date_from, active_date_to, inactive_page_title, inactive_page_message added to forms the import/export flow.
0.13¶
2018-02-25
Note
This release contains minor backwards incompatible changes. A number of new database fields have been added to the FormEntry model (active_date_from, active_date_to, inactive_page_title, inactive_page_message). You will need to migrate your database.
Implement disabling forms based on dates. Note, that although the feature is landed into the core, contrib packages (such as Foundation 5 theme, Simple theme, Django CMS admin style theme, DRF integration app, FeinCMS integration app, Mezzanine integration app, DjangoCMS integration app and Wagtail app) are not yet updated to reflect these changes. It’s a work in progress to be done in the nearest minor releases. Check the issue #143 for state of the progress.
0.12.18¶
2018-02-19
Improved form element add drop-down order.
Add initial migrations for DjangoCMS integration app.
Add French translations.
Implemented styles for
bleach
withincontent_richtext
plugin.Documentation improvements.
0.12.17¶
2018-02-14
Security fixes in db_store plugin.
Minor fixes and cleanups.
If CKEditor is installed, use it (rich text) for success page message.
0.12.16¶
2018-01-21
Note
Note, that this release contains minor backwards incompatible changes, that may slightly break your JS and/or styling.
The form-horizontal class attribute on the main form with elements (in templates) has been replaced with fobi-form id attribute.
Affected files:
src/fobi/templates/fobi/generic/add_form_element_entry_ajax.html
src/fobi/templates/fobi/generic/edit_form_element_entry_ajax.html
src/fobi/templates/fobi/generic/snippets/form_ajax.html
If you have modified any of these, you might want to check and update your code.
Invisible reCAPTCHA form plugin (security) added.
Clean up templates.
Introduce a form_id block. The following templates were affected.
0.12.15¶
2018-01-17
Minor clean up of HTML templates (in some templates
hidden_form_element_wrapper_html_class
was used while othersform_element_wrapper_hidden_html_class
). Nowform_element_wrapper_hidden_html_class
is used everywhere. Some HTML files have been re-indented (2 spaces).Minor clean up of JS.
Optionally limit file extensions for file upload element
0.12.14¶
2018-01-10
Minor clean up of HTML templates (unused classes removed).
Nicer captcha (simple captcha) for bootstrap3 and foundation5 themes.
0.12.13¶
2018-01-09
Note
Note, that this release contains minor backwards incompatible changes, that may slightly break your JS and/or styling.
The form-horizontal class attribute on the main form with elements (in templates) has been replaced with fobi-form id attribute.
Affected files:
/src/fobi/contrib/themes/djangocms_admin_style_theme/static/djangocms_admin_style_theme/js/fobi.djangocms_admin_style_theme.edit.js
/src/fobi/contrib/themes/djangocms_admin_style_theme/templates/djangocms_admin_style_theme/edit_form_entry_ajax.html
/src/fobi/contrib/themes/foundation5/static/foundation5/js/foundation5_fobi_extras.js
/src/fobi/contrib/themes/foundation5/templates/foundation5/edit_form_entry_ajax.html
/src/fobi/contrib/themes/foundation5/templates/foundation5/edit_form_wizard_entry_ajax.html
/src/fobi/contrib/themes/simple/static/simple/js/fobi.simple.edit.js
/src/fobi/contrib/themes/simple/templates/simple/edit_form_entry_ajax.html
/src/fobi/contrib/themes/simple/templates/simple/edit_form_wizard_entry_ajax.html
/src/fobi/contrib/themes/bootstrap3/static/bootstrap3/js/bootstrap3_fobi_extras.js
/src/fobi/templates/fobi/generic/edit_form_entry_ajax.html
If you have modified any of these, please double check that your edit views work and look properly.
Fixes in simple and django-cms-admin-style themes (assets being loaded incorrectly since 0.12.6).
Base template, as well as templates of all the themes have been made a little bit more flexible.
Minor documentation fixes.
0.12.12¶
2018-01-03
More consistent loading of assets (JS, CSS) in add- and edit-form-element-entry templates.
Copyright and licenses year update.
Minor fixes in the widgets.
Clean up.
0.12.10¶
2017-12-24
Django 2.0 support (experimental).
(Temporary) replace
django-autoslug
package withdjango-autoslug-iplweb
, which works fine for Django versions >=1.8,<=2.0.
0.12.8¶
2017-12-19
Added common form callback
AutoFormMail
for auto mailing the form data (without need to add the mail plugin to the form).
0.12.7¶
2017-12-17
Minor fixes (in the add form element entry bootstrap3 template).
Add content rich text plugin (based on CKEditor).
Added common form callback
AutoFormDbStore
for auto saving the form data (without need to add the db_store plugin to the form).
0.12.6¶
2017-12-12
Clean up.
Minor documentation fixes.
Minor plugin clean-up/fixes (
captcha
,recaptcha
,content_text
).Minor Python 3 fixes.
Minor fixes in FormWizard
get_absolute_url
method.
0.12.3¶
2017-09-27
Minor fixes.
Reflect form-wizards support changes in the foundation5 theme.
Documentation fixes.
0.12.2¶
2017-08-02
Some work on full form-wizards support in the foundation5 theme.
Django 1.11 fixes for customised widgets.
Update example project requirements.
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
indrf_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 themailchimp_importer
plugin.
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 toxls
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.5¶
2017-05-15
Added
date_drop_down
todrf_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
andcontent_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¶
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
andslider
form element plugins.Minor Python3 fixes in
http_repost
andmail
form handler plugins.
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¶
2016-11-16
Note
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 thetitle
field ofFormEntry
andFormWizardEntry
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
Note
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.13¶
2016-11-05
Note
Announcing dropping support of Django 1.5 and 1.6. As of 0.9.13 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.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.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.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¶
2016-10-24
Note
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!
The :method:`get_form_field_instances` and :method:`_get_form_field_instances` of the
fobi.base.FormElementPlugin
both accept two new optional arguments: form_entry and form_element_entries as well as **kwargs. Make sure to update your custom plugins if you have written any.Minor fixes in the form wizards: forms in intermediate steps do receive updates from the submit_plugin_form_data of the plugins.
Fixed issue in the base_bulk_change_plugins function on Django 1.10.
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.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¶
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 fully 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.
Note
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.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¶
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.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.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.
Note
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.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.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.2¶
2015-04-26
0.5¶
2015-04-06
Note
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 rename a couple of database tables and update references accordingly. No migrations to solve the issue are included at the moment.
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, instead 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.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 onfrom 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 ofdjango.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.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 thedb_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 thebootstrap3
theme.Fixed
db_store
issue with CSV/XLS export failing on Django 1.7.
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.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 thesix
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 thedb_store
plugin.Apply that to the
honeypot
andcaptcha
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 todate_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.*:Install django-fobi>=0.4.2:
pip install django-fobi>=0.4.2
In your settings change the:
'fobi.contrib.plugins.form_elements.fields.birthday'
to:
'fobi.contrib.plugins.form_elements.fields.date_drop_down'
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
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 fromfobi.contrib.plugins.form_elements.fields.captcha
tofobi.contrib.plugins.form_elements.security.captcha
. Make sure to update the package paths inINSTALLED_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 todate_drop_down
(A realbirthday
field is still to come in later releases). The change causes backwards incompatibility issues if you have used thatbirthday
field. If you haven’t - you have nothing to worry. If you have been using it, grab the 0.3.4 version, copy thefobi.contrib.plugins.form_elements.fields.date_drop_down
package to your project apps, make necessary path changes and update the package paths inINSTALLED_APPS
settings module (settings.py) before upgrading to this version. Then, in Django admin management interface, replace all the occurrences ofBirthday
field withDate 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 theis_hidden
is set to False.
0.3.4¶
2014-11-23
New settings
FOBI_FAIL_ON_ERRORS_IN_FORM_ELEMENT_PLUGINS
andFOBI_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¶
2014-11-09
Note
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 theming 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 tofobi.contrib.plugins.form_elements.content.content_image
. Thefobi.contrib.plugins.form_elements.content.text
plugin has been renamed tofobi.contrib.plugins.form_elements.content.content_text
. Thefobi.contrib.plugins.form_elements.content.video
plugin has been renamed tofobi.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 thesettings
module of your project.The
fobi.contrib.plugins.form_elements.content.dummy
plugin has been moved tofobi.contrib.plugins.form_elements.test.dummy
location. If you have used it, make sure to update the its’ path in thesettings
module of your project.Added readme to the following content form element plugins:
dummy
,content_image
,content_text
andcontent_video
.Added
foundation5
andsimple
theme widgets fordb_store
plugin.If you have been overriding the defaults of the
db_store
plugin, change the prefix fromFOBI_PLUGIN_DB_EXPORT_
toFOBI_PLUGIN_DB_STORE_
. For example,FOBI_PLUGIN_DB_EXPORT_CSV_DELIMITER
should becomeFOBI_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
andget_custom_actions
methods acceptform_entry
(obligatory) andrequest
(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, theview_form_entry_ajax_template
is used. For a success page theembed_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.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).
Licenses¶
Below information about third-party packages used in the project is presented.
Bootstrap 3 DateTime picker¶
bootstrap-slider¶
django-nine¶
https://github.com/barseghyanartur/django-nine
Licensing information:
GPL 2.0 (http://www.gnu.org/licenses/gpl-2.0.html)
LGPL 2.1 (https://www.gnu.org/licenses/lgpl-2.1.html)
django-nonefield¶
https://github.com/barseghyanartur/django-nonefield
Licensing information:
GPL 2.0 (http://www.gnu.org/licenses/gpl-2.0.html)
LGPL 2.1 (https://www.gnu.org/licenses/lgpl-2.1.html)
Font-awesome¶
Licensing information:
Foundation 5¶
Licensing information:
Foundation 5 DateTime picker¶
https://github.com/aliibrahim/foundation-datetimepicker-rails
Licensing information:
jQuery¶
Licensing information:
jQueryUI¶
Licensing information:
moment.js¶
Licensing information:
Pillow¶
http://python-pillow.github.io/
Licensing information:
Python Imaging Library license (http://www.pythonware.com/products/pil/)
Requests¶
Licensing information:
Six¶
https://bitbucket.org/gutworth/six/
Licensing information:
Apache 2.0 (http://opensource.org/licenses/Apache-2.0)
Unidecode¶
https://pypi.python.org/pypi/Unidecode
Licensing information:
GPL 2.0 (http://www.gnu.org/licenses/gpl-2.0.html)
vishap¶
https://pypi.python.org/pypi/vishap
Licensing information:
GPL 2.0 (http://www.gnu.org/licenses/gpl-2.0.html)
LGPL 2.1 (https://www.gnu.org/licenses/lgpl-2.1.html)
fobi package¶
Subpackages¶
fobi.contrib package¶
Subpackages¶
- 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.
WIDGET_FORM_SENT (str): Name of the GET param indicating that form has been successfully sent.
- class fobi.contrib.apps.drf_integration.form_elements.content.content_image.apps.Config(app_name, app_module)[source]¶
Bases:
django.apps.config.AppConfig
Config.
- label = 'fobi_contrib_apps_drf_integration_form_elements_content_content_image'¶
- name = 'fobi.contrib.apps.drf_integration.form_elements.content.content_image'¶
- 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 = 'Content'¶
- integrate_with = 'drf_integration'¶
- name = 'Content image'¶
- uid = 'content_image'¶
- 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 = 'Content'¶
- integrate_with = 'drf_integration'¶
- name = 'Content image'¶
- uid = 'content_image'¶
- class fobi.contrib.apps.drf_integration.form_elements.content.content_image_url.apps.Config(app_name, app_module)[source]¶
Bases:
django.apps.config.AppConfig
Config.
- label = 'fobi_contrib_apps_drf_integration_form_elements_content_content_image_url'¶
- name = 'fobi.contrib.apps.drf_integration.form_elements.content.content_image_url'¶
- 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 = 'Content'¶
- integrate_with = 'drf_integration'¶
- name = 'Content image URL'¶
- uid = 'content_image_url'¶
- 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 = 'Content'¶
- integrate_with = 'drf_integration'¶
- name = 'Content image URL'¶
- uid = 'content_image_url'¶
- class fobi.contrib.apps.drf_integration.form_elements.content.content_markdown.apps.Config(app_name, app_module)[source]¶
Bases:
django.apps.config.AppConfig
Config.
- label = 'fobi_contrib_apps_drf_integration_form_elements_content_content_markdown'¶
- name = 'fobi.contrib.apps.drf_integration.form_elements.content.content_markdown'¶
- class fobi.contrib.apps.drf_integration.form_elements.content.content_markdown.base.ContentMarkdownPlugin(user=None)[source]¶
Bases:
fobi.base.IntegrationFormElementPlugin
,fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin
Content markdown (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 = 'Content'¶
- integrate_with = 'drf_integration'¶
- name = 'Content markdown'¶
- uid = 'content_markdown'¶
- class fobi.contrib.apps.drf_integration.form_elements.content.content_markdown.fobi_integration_form_elements.ContentMarkdownPlugin(user=None)[source]¶
Bases:
fobi.base.IntegrationFormElementPlugin
,fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin
Content markdown (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 = 'Content'¶
- integrate_with = 'drf_integration'¶
- name = 'Content markdown'¶
- uid = 'content_markdown'¶
- class fobi.contrib.apps.drf_integration.form_elements.content.content_richtext.apps.Config(app_name, app_module)[source]¶
Bases:
django.apps.config.AppConfig
Config.
- label = 'fobi_contrib_apps_drf_integration_form_elements_content_content_richtext'¶
- name = 'fobi.contrib.apps.drf_integration.form_elements.content.content_richtext'¶
- class fobi.contrib.apps.drf_integration.form_elements.content.content_richtext.base.ContentRichTextPlugin(user=None)[source]¶
Bases:
fobi.base.IntegrationFormElementPlugin
,fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin
Content rich text (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 = 'Content'¶
- integrate_with = 'drf_integration'¶
- name = 'Content rich text'¶
- uid = 'content_richtext'¶
- class fobi.contrib.apps.drf_integration.form_elements.content.content_richtext.fobi_integration_form_elements.ContentRichTextPlugin(user=None)[source]¶
Bases:
fobi.base.IntegrationFormElementPlugin
,fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin
Content rich text (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 = 'Content'¶
- integrate_with = 'drf_integration'¶
- name = 'Content rich text'¶
- uid = 'content_richtext'¶
- class fobi.contrib.apps.drf_integration.form_elements.content.content_text.apps.Config(app_name, app_module)[source]¶
Bases:
django.apps.config.AppConfig
Config.
- label = 'fobi_contrib_apps_drf_integration_form_elements_content_content_text'¶
- name = 'fobi.contrib.apps.drf_integration.form_elements.content.content_text'¶
- 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 = 'Content'¶
- integrate_with = 'drf_integration'¶
- name = 'Content text'¶
- uid = 'content_text'¶
- 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 = 'Content'¶
- integrate_with = 'drf_integration'¶
- name = 'Content text'¶
- uid = 'content_text'¶
- class fobi.contrib.apps.drf_integration.form_elements.content.content_video.apps.Config(app_name, app_module)[source]¶
Bases:
django.apps.config.AppConfig
Config.
- label = 'fobi_contrib_apps_drf_integration_form_elements_content_content_video'¶
- name = 'fobi.contrib.apps.drf_integration.form_elements.content.content_video'¶
- 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 = 'Content'¶
- integrate_with = 'drf_integration'¶
- name = 'Content image'¶
- uid = 'content_video'¶
- 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 = 'Content'¶
- integrate_with = 'drf_integration'¶
- name = 'Content image'¶
- uid = 'content_video'¶
- class fobi.contrib.apps.drf_integration.form_elements.fields.boolean.apps.Config(app_name, app_module)[source]¶
Bases:
django.apps.config.AppConfig
Config.
- label = 'fobi_contrib_apps_drf_integration_form_elements_fields_boolean'¶
- name = 'fobi.contrib.apps.drf_integration.form_elements.fields.boolean'¶
- 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 = 'Fields'¶
- integrate_with = 'drf_integration'¶
- name = 'Boolean'¶
- uid = 'boolean'¶
- 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 = 'Fields'¶
- integrate_with = 'drf_integration'¶
- name = 'Boolean'¶
- uid = 'boolean'¶
- class fobi.contrib.apps.drf_integration.form_elements.fields.checkbox_select_multiple.apps.Config(app_name, app_module)[source]¶
Bases:
django.apps.config.AppConfig
Config.
- label = 'fobi_contrib_apps_drf_integration_form_elements_fields_checkbox_select_multiple'¶
- name = 'fobi.contrib.apps.drf_integration.form_elements.fields.checkbox_select_multiple'¶
- 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 = 'Fields'¶
- integrate_with = 'drf_integration'¶
- name = 'Checkbox select multiple'¶
- 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'¶
- 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 = 'Fields'¶
- integrate_with = 'drf_integration'¶
- name = 'Checkbox select multiple'¶
- 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'¶
- 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 = 'Fields'¶
- integrate_with = 'drf_integration'¶
- name = 'Date'¶
- uid = 'date'¶
- 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 = 'Fields'¶
- integrate_with = 'drf_integration'¶
- name = 'Date'¶
- uid = 'date'¶
- class fobi.contrib.apps.drf_integration.form_elements.fields.date_drop_down.apps.Config(app_name, app_module)[source]¶
Bases:
django.apps.config.AppConfig
Config.
- label = 'fobi_contrib_apps_drf_integration_form_elements_fields_date_drop_down'¶
- name = 'fobi.contrib.apps.drf_integration.form_elements.fields.date_drop_down'¶
- 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 = 'Fields'¶
- integrate_with = 'drf_integration'¶
- name = 'Date drop down'¶
- uid = 'date_drop_down'¶
- 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 = 'Fields'¶
- integrate_with = 'drf_integration'¶
- name = 'Date drop down'¶
- uid = 'date_drop_down'¶
- class fobi.contrib.apps.drf_integration.form_elements.fields.datetime.apps.Config(app_name, app_module)[source]¶
Bases:
django.apps.config.AppConfig
Config.
- label = 'fobi_contrib_apps_drf_integration_form_elements_fields_datetime'¶
- name = 'fobi.contrib.apps.drf_integration.form_elements.fields.datetime'¶
- 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 = 'Fields'¶
- integrate_with = 'drf_integration'¶
- name = 'DateTime'¶
- uid = 'datetime'¶
- 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 = 'Fields'¶
- integrate_with = 'drf_integration'¶
- name = 'DateTime'¶
- uid = 'datetime'¶
- class fobi.contrib.apps.drf_integration.form_elements.fields.decimal.apps.Config(app_name, app_module)[source]¶
Bases:
django.apps.config.AppConfig
Config.
- label = 'fobi_contrib_apps_drf_integration_form_elements_fields_decimal'¶
- name = 'fobi.contrib.apps.drf_integration.form_elements.fields.decimal'¶
- 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 = 'Fields'¶
- integrate_with = 'drf_integration'¶
- name = 'Decimal'¶
- uid = 'decimal'¶
- 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 = 'Fields'¶
- integrate_with = 'drf_integration'¶
- name = 'Decimal'¶
- uid = 'decimal'¶
- class fobi.contrib.apps.drf_integration.form_elements.fields.duration.apps.Config(app_name, app_module)[source]¶
Bases:
django.apps.config.AppConfig
Config.
- label = 'fobi_contrib_apps_drf_integration_form_elements_fields_duration'¶
- name = 'fobi.contrib.apps.drf_integration.form_elements.fields.duration'¶
- class fobi.contrib.apps.drf_integration.form_elements.fields.duration.base.DurationInputPlugin(user=None)[source]¶
Bases:
fobi.base.IntegrationFormFieldPlugin
,fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin
DurationField plugin.
- get_custom_field_instances(form_element_plugin, request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Fields'¶
- integrate_with = 'drf_integration'¶
- name = 'Duration'¶
- 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 = 'duration'¶
- class fobi.contrib.apps.drf_integration.form_elements.fields.duration.fobi_integration_form_elements.DurationInputPlugin(user=None)[source]¶
Bases:
fobi.base.IntegrationFormFieldPlugin
,fobi.contrib.apps.drf_integration.base.DRFSubmitPluginFormDataMixin
DurationField plugin.
- get_custom_field_instances(form_element_plugin, request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Fields'¶
- integrate_with = 'drf_integration'¶
- name = 'Duration'¶
- 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 = 'duration'¶
- 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 = 'Fields'¶
- integrate_with = 'drf_integration'¶
- name = 'Decimal'¶
- uid = 'email'¶
- 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 = 'Fields'¶
- integrate_with = 'drf_integration'¶
- name = 'Decimal'¶
- uid = 'email'¶
- 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 = 'Fields'¶
- integrate_with = 'drf_integration'¶
- name = 'File'¶
- 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'¶
- 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 = 'Fields'¶
- integrate_with = 'drf_integration'¶
- name = 'File'¶
- 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'¶
- 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 = 'Fields'¶
- integrate_with = 'drf_integration'¶
- name = 'Float'¶
- uid = 'float'¶
- 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 = 'Fields'¶
- integrate_with = 'drf_integration'¶
- name = 'Float'¶
- uid = 'float'¶
- 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 = 'Fields'¶
- integrate_with = 'drf_integration'¶
- name = 'Text'¶
- uid = 'input'¶
- class fobi.contrib.apps.drf_integration.form_elements.fields.input.fobi_integration_form_elements.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 = 'Fields'¶
- integrate_with = 'drf_integration'¶
- name = 'Text'¶
- uid = 'input'¶
- class fobi.contrib.apps.drf_integration.form_elements.fields.integer.apps.Config(app_name, app_module)[source]¶
Bases:
django.apps.config.AppConfig
Config.
- label = 'fobi_contrib_apps_drf_integration_form_elements_fields_integer'¶
- name = 'fobi.contrib.apps.drf_integration.form_elements.fields.integer'¶
- 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 = 'Fields'¶
- integrate_with = 'drf_integration'¶
- name = 'Integer'¶
- uid = 'integer'¶
- 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 = 'Fields'¶
- integrate_with = 'drf_integration'¶
- name = 'Integer'¶
- uid = 'integer'¶
- class fobi.contrib.apps.drf_integration.form_elements.fields.ip_address.apps.Config(app_name, app_module)[source]¶
Bases:
django.apps.config.AppConfig
Config.
- label = 'fobi_contrib_apps_drf_integration_form_elements_fields_ip_address'¶
- name = 'fobi.contrib.apps.drf_integration.form_elements.fields.ip_address'¶
- 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 = 'Fields'¶
- integrate_with = 'drf_integration'¶
- name = 'IP address'¶
- uid = 'ip_address'¶
- 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 = 'Fields'¶
- integrate_with = 'drf_integration'¶
- name = 'IP address'¶
- uid = 'ip_address'¶
- class fobi.contrib.apps.drf_integration.form_elements.fields.null_boolean.apps.Config(app_name, app_module)[source]¶
Bases:
django.apps.config.AppConfig
Config.
- label = 'fobi_contrib_apps_drf_integration_form_elements_fields_null_boolean'¶
- name = 'fobi.contrib.apps.drf_integration.form_elements.fields.null_boolean'¶
- 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 = 'Fields'¶
- integrate_with = 'drf_integration'¶
- name = 'Null boolean'¶
- uid = 'null_boolean'¶
- 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 = 'Fields'¶
- integrate_with = 'drf_integration'¶
- name = 'Null boolean'¶
- uid = 'null_boolean'¶
- class fobi.contrib.apps.drf_integration.form_elements.fields.password.apps.Config(app_name, app_module)[source]¶
Bases:
django.apps.config.AppConfig
Config.
- label = 'fobi_contrib_apps_drf_integration_form_elements_fields_password'¶
- name = 'fobi.contrib.apps.drf_integration.form_elements.fields.password'¶
- 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 = 'Fields'¶
- integrate_with = 'drf_integration'¶
- name = 'Text'¶
- uid = 'password'¶
- 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 = 'Fields'¶
- integrate_with = 'drf_integration'¶
- name = 'Text'¶
- uid = 'password'¶
- 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 = 'Fields'¶
- integrate_with = 'drf_integration'¶
- name = 'Radio'¶
- uid = 'radio'¶
- 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 = 'Fields'¶
- integrate_with = 'drf_integration'¶
- name = 'Radio'¶
- uid = 'radio'¶
- class fobi.contrib.apps.drf_integration.form_elements.fields.range_select.apps.Config(app_name, app_module)[source]¶
Bases:
django.apps.config.AppConfig
Config.
- label = 'fobi_contrib_apps_drf_integration_form_elements_fields_range_select'¶
- name = 'fobi.contrib.apps.drf_integration.form_elements.fields.range_select'¶
- 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 = 'Fields'¶
- integrate_with = 'drf_integration'¶
- name = 'Range select'¶
- uid = 'range_select'¶
- 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 = 'Fields'¶
- integrate_with = 'drf_integration'¶
- name = 'Range select'¶
- uid = 'range_select'¶
- 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 = 'Fields'¶
- integrate_with = 'drf_integration'¶
- name = 'Regex'¶
- uid = 'regex'¶
- 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 = 'Fields'¶
- integrate_with = 'drf_integration'¶
- name = 'Regex'¶
- uid = 'regex'¶
- 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 = 'Fields'¶
- integrate_with = 'drf_integration'¶
- name = 'Select'¶
- uid = 'select'¶
- 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 = 'Fields'¶
- integrate_with = 'drf_integration'¶
- name = 'Select'¶
- uid = 'select'¶
- class fobi.contrib.apps.drf_integration.form_elements.fields.select_model_object.apps.Config(app_name, app_module)[source]¶
Bases:
django.apps.config.AppConfig
Config.
- label = 'fobi_contrib_apps_drf_integration_form_elements_fields_select_model_object'¶
- name = 'fobi.contrib.apps.drf_integration.form_elements.fields.select_model_object'¶
- 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 = 'Fields'¶
- integrate_with = 'drf_integration'¶
- name = 'Select model 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'¶
- 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 = 'Fields'¶
- integrate_with = 'drf_integration'¶
- name = 'Select model 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'¶
- class fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple.apps.Config(app_name, app_module)[source]¶
Bases:
django.apps.config.AppConfig
Config.
- label = 'fobi_contrib_apps_drf_integration_form_elements_fields_select_multiple'¶
- name = 'fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple'¶
- 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 = 'Fields'¶
- integrate_with = 'drf_integration'¶
- name = 'Select multiple'¶
- 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'¶
- 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 = 'Fields'¶
- integrate_with = 'drf_integration'¶
- name = 'Select multiple'¶
- 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'¶
- 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
Config.
- 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'¶
- 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 = 'Fields'¶
- integrate_with = 'drf_integration'¶
- name = 'Select multiple model objects'¶
- 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'¶
- 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 = 'Fields'¶
- integrate_with = 'drf_integration'¶
- name = 'Select multiple model objects'¶
- 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'¶
- 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
Config.
- 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'¶
- 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 = 'Fields'¶
- integrate_with = 'drf_integration'¶
- name = 'Select multiple with max'¶
- 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'¶
- 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 = 'Fields'¶
- integrate_with = 'drf_integration'¶
- name = 'Select multiple with max'¶
- 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'¶
- 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 = 'Fields'¶
- integrate_with = 'drf_integration'¶
- name = 'Slider'¶
- uid = 'slider'¶
- 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 = 'Fields'¶
- integrate_with = 'drf_integration'¶
- name = 'Slider'¶
- uid = 'slider'¶
- 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 = 'Fields'¶
- integrate_with = 'drf_integration'¶
- name = 'Slug'¶
- uid = 'slug'¶
- 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 = 'Fields'¶
- integrate_with = 'drf_integration'¶
- name = 'Slug'¶
- uid = 'slug'¶
- 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 = 'Fields'¶
- integrate_with = 'drf_integration'¶
- name = 'Text'¶
- uid = 'text'¶
- 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 = 'Fields'¶
- integrate_with = 'drf_integration'¶
- name = 'Text'¶
- uid = 'text'¶
- class fobi.contrib.apps.drf_integration.form_elements.fields.textarea.apps.Config(app_name, app_module)[source]¶
Bases:
django.apps.config.AppConfig
Config.
- label = 'fobi_contrib_apps_drf_integration_form_elements_fields_textarea'¶
- name = 'fobi.contrib.apps.drf_integration.form_elements.fields.textarea'¶
- 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 = 'Fields'¶
- integrate_with = 'drf_integration'¶
- name = 'Textarea'¶
- uid = 'textarea'¶
- 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 = 'Fields'¶
- integrate_with = 'drf_integration'¶
- name = 'Textarea'¶
- uid = 'textarea'¶
- 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 = 'Fields'¶
- integrate_with = 'drf_integration'¶
- name = 'Time'¶
- uid = 'time'¶
- 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 = 'Fields'¶
- integrate_with = 'drf_integration'¶
- name = 'Time'¶
- uid = 'time'¶
- 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 = 'Fields'¶
- integrate_with = 'drf_integration'¶
- name = 'URL'¶
- uid = 'url'¶
- 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 = 'Fields'¶
- integrate_with = 'drf_integration'¶
- name = 'URL'¶
- uid = 'url'¶
- 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 = 'DB store'¶
- uid = 'db_store'¶
- 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 = 'Mail'¶
- uid = 'mail'¶
- class fobi.contrib.apps.drf_integration.base.DRFIntegrationFormElementPluginProcessor(*args, **kwargs)[source]¶
Bases:
fobi.base.IntegrationFormElementPluginProcessor
Django REST framework field instance processor.
- 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
andfobi.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.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) –
- class fobi.contrib.apps.drf_integration.fields.ContentImageField(*args, **kwargs)[source]¶
Bases:
fobi.contrib.apps.drf_integration.fields.NoneField
Content image field.
- class fobi.contrib.apps.drf_integration.fields.ContentMarkdownField(*args, **kwargs)[source]¶
Bases:
fobi.contrib.apps.drf_integration.fields.NoneField
Content markdown field.
- class fobi.contrib.apps.drf_integration.fields.ContentRichTextField(*args, **kwargs)[source]¶
Bases:
fobi.contrib.apps.drf_integration.fields.NoneField
Content rich text field.
- class fobi.contrib.apps.drf_integration.fields.ContentTextField(*args, **kwargs)[source]¶
Bases:
fobi.contrib.apps.drf_integration.fields.NoneField
Content text field.
- class fobi.contrib.apps.drf_integration.fields.ContentVideoField(*args, **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 = {'empty': 'This selection may not be empty.', 'invalid_choice': '"{input}" is not a valid choice.', 'max_choices': 'Max number of choices reached.', 'not_a_list': 'Expected a list of items but got type "{input_type}".'}¶
- class fobi.contrib.apps.drf_integration.fields.NoneField(*args, **kwargs)[source]¶
Bases:
rest_framework.fields.Field
NoneField.
- default_empty_html = ''¶
- default_error_messages = {}¶
- initial = ''¶
- 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>¶
- class fobi.contrib.apps.drf_integration.serializers.FormEntrySerializer(*args, **kwargs)[source]¶
Bases:
rest_framework.serializers.ModelSerializer
FormEntry serializer (read-only).
Used for detail and list views.
- 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
- 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.
- basename = None¶
- description = None¶
- detail = None¶
- get_queryset()[source]¶
Get queryset.
We show all forms to authenticated users and show only public forms to non-authenticated users.
- lookup_field = 'slug'¶
- lookup_url_kwarg = 'slug'¶
- metadata_class¶
alias of
fobi.contrib.apps.drf_integration.metadata.FobiMetaData
- name = None¶
- permission_classes = [<class 'rest_framework.permissions.AllowAny'>]¶
- queryset¶
- suffix = None¶
- 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.
WIDGET_FORM_SENT_GET_PARAM (str): Name of the GET param indicating that form has been successfully sent.
- 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.
- can_redirect = True¶
- form_entry¶
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- 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.
- form_sent_get_param = 'sent'¶
- 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.
- 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.
- form_title¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- get_form_template_name_display(*, field=<django.db.models.fields.CharField: form_template_name>)¶
- get_success_page_template_name_display(*, field=<django.db.models.fields.CharField: success_page_template_name>)¶
- 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.
- 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.
- process(request, **kwargs)[source]¶
This is where most of the form handling happens.
- Parameters
request (django.http.HttpRequest) –
- Return django.http.HttpResponse | str
- 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.
- 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.
- 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.
- 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.
WIDGET_FORM_SENT_GET_PARAM (str): Name of the GET param indicating that form has been successfully sent.
- 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
?
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Content'¶
- name = 'Content image'¶
- uid = 'content_image'¶
- 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.
- 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
?
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Content'¶
- name = 'Content image'¶
- uid = 'content_image'¶
- class fobi.contrib.plugins.form_elements.content.content_image.forms.ContentImageForm(data=None, files=None, auto_id='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, renderer=None)[source]¶
Bases:
django.forms.forms.Form
,fobi.base.BasePluginForm
Form for
ContentImagePlugin
.- base_fields = {'alt': <django.forms.fields.CharField object>, 'file': <django.forms.fields.ImageField object>, 'fit_method': <django.forms.fields.ChoiceField object>, 'size': <django.forms.fields.ChoiceField object>}¶
- declared_fields = {'alt': <django.forms.fields.CharField object>, 'file': <django.forms.fields.ImageField object>, 'fit_method': <django.forms.fields.ChoiceField object>, 'size': <django.forms.fields.ChoiceField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- plugin_data_fields = [('file', ''), ('alt', ''), ('fit_method', 'center'), ('size', '500x500')]¶
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)
- 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
fobi.contrib.plugins.form_elements.content.content_image_url.forms.ContentImageURLForm
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Content'¶
- name = 'Content image URL'¶
- uid = 'content_image_url'¶
- 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.
- 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
fobi.contrib.plugins.form_elements.content.content_image_url.forms.ContentImageURLForm
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Content'¶
- name = 'Content image URL'¶
- uid = 'content_image_url'¶
- class fobi.contrib.plugins.form_elements.content.content_image_url.forms.ContentImageURLForm(data=None, files=None, auto_id='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, renderer=None)[source]¶
Bases:
django.forms.forms.Form
,fobi.base.BasePluginForm
Form for
ContentImageURLPlugin
.- base_fields = {'alt': <django.forms.fields.CharField object>, 'fit_method': <django.forms.fields.ChoiceField object>, 'size': <django.forms.fields.ChoiceField object>, 'url': <django.forms.fields.URLField object>}¶
- declared_fields = {'alt': <django.forms.fields.CharField object>, 'fit_method': <django.forms.fields.ChoiceField object>, 'size': <django.forms.fields.ChoiceField object>, 'url': <django.forms.fields.URLField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- plugin_data_fields = [('url', ''), ('alt', ''), ('fit_method', 'fit_width'), ('size', '500x500')]¶
DEFAULT_SIZE
(string)SIZE_100x100
(string)SIZE_200x200
(string)SIZE_300x300
(string)SIZE_400x400
(string)SIZE_500x500
(string)SIZE_600x600
(tuple)SIZES
(list)
- class fobi.contrib.plugins.form_elements.content.content_markdown.base.ContentMarkdownPlugin(user=None)[source]¶
Bases:
fobi.base.FormElementPlugin
Content markdown plugin.
- form¶
alias of
fobi.contrib.plugins.form_elements.content.content_markdown.forms.ContentMarkdownForm
- 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
request (django.http.HttpRequest) –
form_entry (fobi.models.FormEntry) –
form_element_entries (django.db.models.QuerySet) – Queryset of
fobi.models.FormElementEntry
instances.
- Return list
List of Django form field instances.
- Example
>>> from django.forms.fields import CharField, IntegerField, TextField >>> [CharField(max_length=100), IntegerField(), TextField()]
- group = 'Content'¶
- html_classes = ['content-markdown']¶
- name = 'Content markdown'¶
- 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).
- uid = 'content_markdown'¶
- class fobi.contrib.plugins.form_elements.content.content_markdown.fobi_form_elements.ContentMarkdownPlugin(user=None)[source]¶
Bases:
fobi.base.FormElementPlugin
Content markdown plugin.
- form¶
alias of
fobi.contrib.plugins.form_elements.content.content_markdown.forms.ContentMarkdownForm
- 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
request (django.http.HttpRequest) –
form_entry (fobi.models.FormEntry) –
form_element_entries (django.db.models.QuerySet) – Queryset of
fobi.models.FormElementEntry
instances.
- Return list
List of Django form field instances.
- Example
>>> from django.forms.fields import CharField, IntegerField, TextField >>> [CharField(max_length=100), IntegerField(), TextField()]
- group = 'Content'¶
- html_classes = ['content-markdown']¶
- name = 'Content markdown'¶
- 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).
- uid = 'content_markdown'¶
- class fobi.contrib.plugins.form_elements.content.content_markdown.forms.ContentMarkdownForm(data=None, files=None, auto_id='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, renderer=None)[source]¶
Bases:
django.forms.forms.Form
,fobi.base.BasePluginForm
ContentMarkDownForm.
- base_fields = {'text': <django.forms.fields.CharField object>}¶
- declared_fields = {'text': <django.forms.fields.CharField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- plugin_data_fields = [('text', '')]¶
- class fobi.contrib.plugins.form_elements.content.content_markdown.widgets.BaseContentMarkdownPluginWidget(plugin)[source]¶
Bases:
fobi.base.FormElementPluginWidget
Base content markdown form element plugin widget.
- html_classes = ['content-markdown']¶
- plugin_uid = 'content_markdown'¶
- class fobi.contrib.plugins.form_elements.content.content_richtext.base.ContentRichTextPlugin(user=None)[source]¶
Bases:
fobi.base.FormElementPlugin
Content rich text plugin.
- form¶
alias of
fobi.contrib.plugins.form_elements.content.content_richtext.forms.ContentRichTextForm
- 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
request (django.http.HttpRequest) –
form_entry (fobi.models.FormEntry) –
form_element_entries (django.db.models.QuerySet) – Queryset of
fobi.models.FormElementEntry
instances.
- Return list
List of Django form field instances.
- Example
>>> from django.forms.fields import CharField, IntegerField, TextField >>> [CharField(max_length=100), IntegerField(), TextField()]
- group = 'Content'¶
- name = 'Content rich text'¶
- 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).
- uid = 'content_richtext'¶
- class fobi.contrib.plugins.form_elements.content.content_richtext.fobi_form_elements.ContentRichTextPlugin(user=None)[source]¶
Bases:
fobi.base.FormElementPlugin
Content rich text plugin.
- form¶
alias of
fobi.contrib.plugins.form_elements.content.content_richtext.forms.ContentRichTextForm
- 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
request (django.http.HttpRequest) –
form_entry (fobi.models.FormEntry) –
form_element_entries (django.db.models.QuerySet) – Queryset of
fobi.models.FormElementEntry
instances.
- Return list
List of Django form field instances.
- Example
>>> from django.forms.fields import CharField, IntegerField, TextField >>> [CharField(max_length=100), IntegerField(), TextField()]
- group = 'Content'¶
- name = 'Content rich text'¶
- 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).
- uid = 'content_richtext'¶
- class fobi.contrib.plugins.form_elements.content.content_richtext.forms.ContentRichTextForm(data=None, files=None, auto_id='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, renderer=None)[source]¶
Bases:
django.forms.forms.Form
,fobi.base.BasePluginForm
ContentRichTextForm.
- base_fields = {'text': <django.forms.fields.CharField object>}¶
- declared_fields = {'text': <django.forms.fields.CharField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- plugin_data_fields = [('text', '')]¶
- class fobi.contrib.plugins.form_elements.content.content_richtext.widgets.BaseContentRichTextPluginWidget(plugin)[source]¶
Bases:
fobi.base.FormElementPluginWidget
Base content rich text form element plugin widget.
- html_classes = ['content-richtext']¶
- media_js = ['ckeditor/ckeditor-init.js', 'ckeditor/ckeditor/ckeditor.js']¶
- plugin_uid = 'content_richtext'¶
- class fobi.contrib.plugins.form_elements.content.content_text.base.ContentTextPlugin(user=None)[source]¶
Bases:
fobi.base.FormElementPlugin
Content text plugin.
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Content'¶
- name = 'Content text'¶
- uid = 'content_text'¶
- 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.
- class fobi.contrib.plugins.form_elements.content.content_text.fobi_form_elements.ContentTextPlugin(user=None)[source]¶
Bases:
fobi.base.FormElementPlugin
Content text plugin.
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Content'¶
- name = 'Content text'¶
- uid = 'content_text'¶
- class fobi.contrib.plugins.form_elements.content.content_text.forms.ContentTextForm(data=None, files=None, auto_id='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, renderer=None)[source]¶
Bases:
django.forms.forms.Form
,fobi.base.BasePluginForm
Form for
ContentTextPlugin
.- base_fields = {'text': <django.forms.fields.CharField object>}¶
- declared_fields = {'text': <django.forms.fields.CharField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- plugin_data_fields = [('text', '')]¶
- class fobi.contrib.plugins.form_elements.content.content_video.base.ContentVideoPlugin(user=None)[source]¶
Bases:
fobi.base.FormElementPlugin
Content video plugin.
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Content'¶
- name = 'Content video'¶
- uid = 'content_video'¶
- 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.
- class fobi.contrib.plugins.form_elements.content.content_video.fobi_form_elements.ContentVideoPlugin(user=None)[source]¶
Bases:
fobi.base.FormElementPlugin
Content video plugin.
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Content'¶
- name = 'Content video'¶
- uid = 'content_video'¶
- class fobi.contrib.plugins.form_elements.content.content_video.forms.ContentVideoForm(data=None, files=None, auto_id='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, renderer=None)[source]¶
Bases:
django.forms.forms.Form
,fobi.base.BasePluginForm
Form for
ContentVideoPlugin
.- base_fields = {'size': <django.forms.fields.ChoiceField object>, 'title': <django.forms.fields.CharField object>, 'url': <django.forms.fields.CharField object>}¶
- declared_fields = {'size': <django.forms.fields.ChoiceField object>, 'title': <django.forms.fields.CharField object>, 'url': <django.forms.fields.CharField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- plugin_data_fields = [('title', ''), ('url', ''), ('size', '500x400')]¶
- class fobi.contrib.plugins.form_elements.fields.boolean.base.BooleanSelectPlugin(user=None)[source]¶
Bases:
fobi.base.FormFieldPlugin
Boolean select plugin.
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Fields'¶
- name = 'Boolean'¶
- uid = 'boolean'¶
- class fobi.contrib.plugins.form_elements.fields.boolean.fobi_form_elements.BooleanSelectPlugin(user=None)[source]¶
Bases:
fobi.base.FormFieldPlugin
Boolean select plugin.
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Fields'¶
- name = 'Boolean'¶
- uid = 'boolean'¶
- class fobi.contrib.plugins.form_elements.fields.boolean.forms.BooleanSelectForm(data=None, files=None, auto_id='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, renderer=None)[source]¶
Bases:
django.forms.forms.Form
,fobi.base.BaseFormFieldPluginForm
Form for
BooleanSelectPlugin
.- base_fields = {'help_text': <django.forms.fields.CharField object>, 'initial': <django.forms.fields.BooleanField object>, 'label': <django.forms.fields.CharField object>, 'name': <django.forms.fields.CharField object>, 'required': <django.forms.fields.BooleanField object>}¶
- declared_fields = {'help_text': <django.forms.fields.CharField object>, 'initial': <django.forms.fields.BooleanField object>, 'label': <django.forms.fields.CharField object>, 'name': <django.forms.fields.CharField object>, 'required': <django.forms.fields.BooleanField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- plugin_data_fields = [('label', ''), ('name', ''), ('help_text', ''), ('initial', ''), ('required', False)]¶
- 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'¶
- 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¶
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Fields'¶
- name = 'Checkbox select multiple'¶
- 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.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.
- 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¶
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Fields'¶
- name = 'Checkbox select multiple'¶
- 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'¶
- class fobi.contrib.plugins.form_elements.fields.checkbox_select_multiple.forms.CheckboxSelectMultipleInputForm(data=None, files=None, auto_id='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, renderer=None)[source]¶
Bases:
django.forms.forms.Form
,fobi.base.BaseFormFieldPluginForm
Form for
CheckboxSelectMultipleInputPlugin
.- base_fields = {'choices': <django.forms.fields.CharField object>, 'help_text': <django.forms.fields.CharField object>, 'initial': <django.forms.fields.CharField object>, 'label': <django.forms.fields.CharField object>, 'name': <django.forms.fields.CharField object>, 'required': <django.forms.fields.BooleanField object>}¶
- declared_fields = {'choices': <django.forms.fields.CharField object>, 'help_text': <django.forms.fields.CharField object>, 'initial': <django.forms.fields.CharField object>, 'label': <django.forms.fields.CharField object>, 'name': <django.forms.fields.CharField object>, 'required': <django.forms.fields.BooleanField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- plugin_data_fields = [('label', ''), ('name', ''), ('choices', ''), ('help_text', ''), ('initial', ''), ('required', False)]¶
- class fobi.contrib.plugins.form_elements.fields.date.base.DateInputPlugin(user=None)[source]¶
Bases:
fobi.base.FormFieldPlugin
Date field plugin.
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Fields'¶
- name = 'Date'¶
- 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'¶
- class fobi.contrib.plugins.form_elements.fields.date.fobi_form_elements.DateInputPlugin(user=None)[source]¶
Bases:
fobi.base.FormFieldPlugin
Date field plugin.
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Fields'¶
- name = 'Date'¶
- 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'¶
- class fobi.contrib.plugins.form_elements.fields.date.forms.DateInputForm(data=None, files=None, auto_id='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, renderer=None)[source]¶
Bases:
django.forms.forms.Form
,fobi.base.BaseFormFieldPluginForm
Form for
DateInputPlugin
.- base_fields = {'help_text': <django.forms.fields.CharField object>, 'initial': <django.forms.fields.DateField object>, 'input_formats': <django.forms.fields.CharField object>, 'label': <django.forms.fields.CharField object>, 'name': <django.forms.fields.CharField object>, 'required': <django.forms.fields.BooleanField object>}¶
- declared_fields = {'help_text': <django.forms.fields.CharField object>, 'initial': <django.forms.fields.DateField object>, 'input_formats': <django.forms.fields.CharField object>, 'label': <django.forms.fields.CharField object>, 'name': <django.forms.fields.CharField object>, 'required': <django.forms.fields.BooleanField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- plugin_data_fields = [('label', ''), ('name', ''), ('help_text', ''), ('initial', ''), ('input_formats', ''), ('required', False)]¶
- 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'¶
- class fobi.contrib.plugins.form_elements.fields.date_drop_down.base.DateDropDownInputPlugin(user=None)[source]¶
Bases:
fobi.base.FormFieldPlugin
Date drop down field plugin.
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Fields'¶
- name = 'Date drop down'¶
- 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'¶
- 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.
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Fields'¶
- name = 'Date drop down'¶
- 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'¶
- class fobi.contrib.plugins.form_elements.fields.date_drop_down.forms.DateDropDownInputForm(data=None, files=None, auto_id='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, renderer=None)[source]¶
Bases:
django.forms.forms.Form
,fobi.base.BaseFormFieldPluginForm
Form for
DateDropDownInputPlugin
.- base_fields = {'help_text': <django.forms.fields.CharField object>, 'initial': <django.forms.fields.CharField object>, 'input_formats': <django.forms.fields.CharField object>, 'label': <django.forms.fields.CharField object>, 'name': <django.forms.fields.CharField object>, 'required': <django.forms.fields.BooleanField object>, 'year_max': <django.forms.fields.IntegerField object>, 'year_min': <django.forms.fields.IntegerField object>}¶
- declared_fields = {'help_text': <django.forms.fields.CharField object>, 'initial': <django.forms.fields.CharField object>, 'input_formats': <django.forms.fields.CharField object>, 'label': <django.forms.fields.CharField object>, 'name': <django.forms.fields.CharField object>, 'required': <django.forms.fields.BooleanField object>, 'year_max': <django.forms.fields.IntegerField object>, 'year_min': <django.forms.fields.IntegerField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- plugin_data_fields = [('label', ''), ('name', ''), ('help_text', ''), ('year_min', ''), ('year_max', ''), ('initial', ''), ('input_formats', ''), ('required', False)]¶
- class fobi.contrib.plugins.form_elements.fields.datetime.base.DateTimeInputPlugin(user=None)[source]¶
Bases:
fobi.base.FormFieldPlugin
DateTime field plugin.
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Fields'¶
- name = 'DateTime'¶
- 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'¶
- class fobi.contrib.plugins.form_elements.fields.datetime.fobi_form_elements.DateTimeInputPlugin(user=None)[source]¶
Bases:
fobi.base.FormFieldPlugin
DateTime field plugin.
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Fields'¶
- name = 'DateTime'¶
- 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'¶
- class fobi.contrib.plugins.form_elements.fields.datetime.forms.DateTimeInputForm(data=None, files=None, auto_id='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, renderer=None)[source]¶
Bases:
django.forms.forms.Form
,fobi.base.BaseFormFieldPluginForm
Form for
DateTimeInputPlugin
.- base_fields = {'help_text': <django.forms.fields.CharField object>, 'initial': <django.forms.fields.DateTimeField object>, 'input_formats': <django.forms.fields.CharField object>, 'label': <django.forms.fields.CharField object>, 'name': <django.forms.fields.CharField object>, 'required': <django.forms.fields.BooleanField object>}¶
- declared_fields = {'help_text': <django.forms.fields.CharField object>, 'initial': <django.forms.fields.DateTimeField object>, 'input_formats': <django.forms.fields.CharField object>, 'label': <django.forms.fields.CharField object>, 'name': <django.forms.fields.CharField object>, 'required': <django.forms.fields.BooleanField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- plugin_data_fields = [('label', ''), ('name', ''), ('help_text', ''), ('initial', ''), ('input_formats', ''), ('required', False)]¶
- 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'¶
- class fobi.contrib.plugins.form_elements.fields.decimal.base.DecimalInputPlugin(user=None)[source]¶
Bases:
fobi.base.FormFieldPlugin
Decimal input plugin.
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Fields'¶
- name = 'Decimal'¶
- uid = 'decimal'¶
- class fobi.contrib.plugins.form_elements.fields.decimal.fobi_form_elements.DecimalInputPlugin(user=None)[source]¶
Bases:
fobi.base.FormFieldPlugin
Decimal input plugin.
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Fields'¶
- name = 'Decimal'¶
- uid = 'decimal'¶
- class fobi.contrib.plugins.form_elements.fields.decimal.forms.DecimalInputForm(data=None, files=None, auto_id='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, renderer=None)[source]¶
Bases:
django.forms.forms.Form
,fobi.base.BaseFormFieldPluginForm
Form for
DecimalInputPlugin
.- base_fields = {'decimal_places': <django.forms.fields.IntegerField object>, 'help_text': <django.forms.fields.CharField object>, 'initial': <django.forms.fields.DecimalField object>, 'label': <django.forms.fields.CharField object>, 'max_digits': <django.forms.fields.IntegerField object>, 'max_value': <django.forms.fields.DecimalField object>, 'min_value': <django.forms.fields.DecimalField object>, 'name': <django.forms.fields.CharField object>, 'placeholder': <django.forms.fields.CharField object>, 'required': <django.forms.fields.BooleanField object>}¶
- declared_fields = {'decimal_places': <django.forms.fields.IntegerField object>, 'help_text': <django.forms.fields.CharField object>, 'initial': <django.forms.fields.DecimalField object>, 'label': <django.forms.fields.CharField object>, 'max_digits': <django.forms.fields.IntegerField object>, 'max_value': <django.forms.fields.DecimalField object>, 'min_value': <django.forms.fields.DecimalField object>, 'name': <django.forms.fields.CharField object>, 'placeholder': <django.forms.fields.CharField object>, 'required': <django.forms.fields.BooleanField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- plugin_data_fields = [('label', ''), ('name', ''), ('help_text', ''), ('initial', ''), ('max_digits', ''), ('decimal_places', ''), ('min_value', None), ('max_value', None), ('required', False), ('placeholder', '')]¶
- class fobi.contrib.plugins.form_elements.fields.duration.base.DurationInputPlugin(user=None)[source]¶
Bases:
fobi.base.FormFieldPlugin
Duration field plugin.
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Fields'¶
- name = 'Duration'¶
- 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 = 'duration'¶
- class fobi.contrib.plugins.form_elements.fields.duration.fobi_form_elements.DurationInputPlugin(user=None)[source]¶
Bases:
fobi.base.FormFieldPlugin
Duration field plugin.
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Fields'¶
- name = 'Duration'¶
- 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 = 'duration'¶
- class fobi.contrib.plugins.form_elements.fields.duration.forms.DurationInputForm(data=None, files=None, auto_id='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, renderer=None)[source]¶
Bases:
django.forms.forms.Form
,fobi.base.BaseFormFieldPluginForm
Form for
DurationInputPlugin
.- base_fields = {'help_text': <django.forms.fields.CharField object>, 'initial': <django.forms.fields.DurationField object>, 'label': <django.forms.fields.CharField object>, 'name': <django.forms.fields.CharField object>, 'placeholder': <django.forms.fields.CharField object>, 'required': <django.forms.fields.BooleanField object>}¶
- declared_fields = {'help_text': <django.forms.fields.CharField object>, 'initial': <django.forms.fields.DurationField object>, 'label': <django.forms.fields.CharField object>, 'name': <django.forms.fields.CharField object>, 'placeholder': <django.forms.fields.CharField object>, 'required': <django.forms.fields.BooleanField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- plugin_data_fields = [('label', ''), ('name', ''), ('help_text', ''), ('initial', ''), ('required', False), ('weeks', ''), ('days', ''), ('hours', ''), ('minutes', ''), ('seconds', ''), ('placeholder', '')]¶
- class fobi.contrib.plugins.form_elements.fields.email.base.EmailInputPlugin(user=None)[source]¶
Bases:
fobi.base.FormFieldPlugin
Email input plugin.
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Fields'¶
- name = 'Email'¶
- uid = 'email'¶
- class fobi.contrib.plugins.form_elements.fields.email.fobi_form_elements.EmailInputPlugin(user=None)[source]¶
Bases:
fobi.base.FormFieldPlugin
Email input plugin.
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Fields'¶
- name = 'Email'¶
- uid = 'email'¶
- class fobi.contrib.plugins.form_elements.fields.email.forms.EmailInputForm(data=None, files=None, auto_id='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, renderer=None)[source]¶
Bases:
django.forms.forms.Form
,fobi.base.BaseFormFieldPluginForm
Form for
EmailInputPlugin
.- base_fields = {'help_text': <django.forms.fields.CharField object>, 'initial': <django.forms.fields.EmailField object>, 'label': <django.forms.fields.CharField object>, 'max_length': <django.forms.fields.IntegerField object>, 'name': <django.forms.fields.CharField object>, 'placeholder': <django.forms.fields.CharField object>, 'required': <django.forms.fields.BooleanField object>}¶
- clean()[source]¶
Hook for doing any extra form-wide cleaning after Field.clean() has been called on every field. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field named ‘__all__’.
- declared_fields = {'help_text': <django.forms.fields.CharField object>, 'initial': <django.forms.fields.EmailField object>, 'label': <django.forms.fields.CharField object>, 'max_length': <django.forms.fields.IntegerField object>, 'name': <django.forms.fields.CharField object>, 'placeholder': <django.forms.fields.CharField object>, 'required': <django.forms.fields.BooleanField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- plugin_data_fields = [('label', ''), ('name', ''), ('help_text', ''), ('initial', ''), ('max_length', '255'), ('required', False), ('placeholder', '')]¶
- class fobi.contrib.plugins.form_elements.fields.file.base.FileInputPlugin(user=None)[source]¶
Bases:
fobi.base.FormFieldPlugin
File field plugin.
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Fields'¶
- name = 'File'¶
- prepare_plugin_form_data(cleaned_data)[source]¶
Prepare plugin form data.
- Parameters
cleaned_data –
- Returns
- 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) –
form_element_entries –
- uid = 'file'¶
- 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.
- class fobi.contrib.plugins.form_elements.fields.file.fobi_form_elements.FileInputPlugin(user=None)[source]¶
Bases:
fobi.base.FormFieldPlugin
File field plugin.
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Fields'¶
- name = 'File'¶
- prepare_plugin_form_data(cleaned_data)[source]¶
Prepare plugin form data.
- Parameters
cleaned_data –
- Returns
- 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) –
form_element_entries –
- uid = 'file'¶
- class fobi.contrib.plugins.form_elements.fields.file.forms.FileInputForm(data=None, files=None, auto_id='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, renderer=None)[source]¶
Bases:
django.forms.forms.Form
,fobi.base.BaseFormFieldPluginForm
Form for
FileInputPlugin
.- base_fields = {'allowed_extensions': <django.forms.fields.CharField object>, 'help_text': <django.forms.fields.CharField object>, 'initial': <django.forms.fields.CharField object>, 'label': <django.forms.fields.CharField object>, 'max_length': <django.forms.fields.IntegerField object>, 'name': <django.forms.fields.CharField object>, 'required': <django.forms.fields.BooleanField object>}¶
- clean()[source]¶
Hook for doing any extra form-wide cleaning after Field.clean() has been called on every field. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field named ‘__all__’.
- declared_fields = {'allowed_extensions': <django.forms.fields.CharField object>, 'help_text': <django.forms.fields.CharField object>, 'initial': <django.forms.fields.CharField object>, 'label': <django.forms.fields.CharField object>, 'max_length': <django.forms.fields.IntegerField object>, 'name': <django.forms.fields.CharField object>, 'required': <django.forms.fields.BooleanField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- plugin_data_fields = [('label', ''), ('name', ''), ('help_text', ''), ('initial', ''), ('max_length', '255'), ('required', False), ('allowed_extensions', '')]¶
FILES_UPLOAD_DIR
(string)
- class fobi.contrib.plugins.form_elements.fields.float.base.FloatInputPlugin(user=None)[source]¶
Bases:
fobi.base.FormFieldPlugin
Float input plugin.
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Fields'¶
- name = 'Float'¶
- uid = 'float'¶
- class fobi.contrib.plugins.form_elements.fields.float.fobi_form_elements.FloatInputPlugin(user=None)[source]¶
Bases:
fobi.base.FormFieldPlugin
Float input plugin.
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Fields'¶
- name = 'Float'¶
- uid = 'float'¶
- class fobi.contrib.plugins.form_elements.fields.float.forms.FloatInputForm(data=None, files=None, auto_id='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, renderer=None)[source]¶
Bases:
django.forms.forms.Form
,fobi.base.BaseFormFieldPluginForm
Form for
FloatInputPlugin
.- base_fields = {'help_text': <django.forms.fields.CharField object>, 'initial': <django.forms.fields.FloatField object>, 'label': <django.forms.fields.CharField object>, 'max_value': <django.forms.fields.FloatField object>, 'min_value': <django.forms.fields.FloatField object>, 'name': <django.forms.fields.CharField object>, 'placeholder': <django.forms.fields.CharField object>, 'required': <django.forms.fields.BooleanField object>}¶
- declared_fields = {'help_text': <django.forms.fields.CharField object>, 'initial': <django.forms.fields.FloatField object>, 'label': <django.forms.fields.CharField object>, 'max_value': <django.forms.fields.FloatField object>, 'min_value': <django.forms.fields.FloatField object>, 'name': <django.forms.fields.CharField object>, 'placeholder': <django.forms.fields.CharField object>, 'required': <django.forms.fields.BooleanField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- plugin_data_fields = [('label', ''), ('name', ''), ('help_text', ''), ('initial', ''), ('min_value', None), ('max_value', None), ('required', False), ('placeholder', '')]¶
- class fobi.contrib.plugins.form_elements.fields.input.base.InputPlugin(user=None)[source]¶
Bases:
fobi.base.FormFieldPlugin
Input field plugin.
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Fields'¶
- name = 'Input'¶
- uid = 'input'¶
- class fobi.contrib.plugins.form_elements.fields.input.fobi_form_elements.InputPlugin(user=None)[source]¶
Bases:
fobi.base.FormFieldPlugin
Input field plugin.
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Fields'¶
- name = 'Input'¶
- uid = 'input'¶
- class fobi.contrib.plugins.form_elements.fields.input.forms.InputForm(data=None, files=None, auto_id='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, renderer=None)[source]¶
Bases:
django.forms.forms.Form
,fobi.base.BaseFormFieldPluginForm
Form for
InputPlugin
.- base_fields = {'autocomplete_value': <django.forms.fields.BooleanField object>, 'autofocus_value': <django.forms.fields.BooleanField object>, 'disabled_value': <django.forms.fields.BooleanField object>, 'help_text': <django.forms.fields.CharField object>, 'initial': <django.forms.fields.CharField object>, 'label': <django.forms.fields.CharField object>, 'list_value': <django.forms.fields.CharField object>, 'max_length': <django.forms.fields.IntegerField object>, 'max_value': <django.forms.fields.CharField object>, 'min_value': <django.forms.fields.CharField object>, 'multiple_value': <django.forms.fields.BooleanField object>, 'name': <django.forms.fields.CharField object>, 'pattern_value': <django.forms.fields.CharField object>, 'placeholder': <django.forms.fields.CharField object>, 'readonly_value': <django.forms.fields.BooleanField object>, 'required': <django.forms.fields.BooleanField object>, 'step_value': <django.forms.fields.IntegerField object>, 'type_value': <django.forms.fields.ChoiceField object>}¶
- clean()[source]¶
Hook for doing any extra form-wide cleaning after Field.clean() has been called on every field. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field named ‘__all__’.
- declared_fields = {'autocomplete_value': <django.forms.fields.BooleanField object>, 'autofocus_value': <django.forms.fields.BooleanField object>, 'disabled_value': <django.forms.fields.BooleanField object>, 'help_text': <django.forms.fields.CharField object>, 'initial': <django.forms.fields.CharField object>, 'label': <django.forms.fields.CharField object>, 'list_value': <django.forms.fields.CharField object>, 'max_length': <django.forms.fields.IntegerField object>, 'max_value': <django.forms.fields.CharField object>, 'min_value': <django.forms.fields.CharField object>, 'multiple_value': <django.forms.fields.BooleanField object>, 'name': <django.forms.fields.CharField object>, 'pattern_value': <django.forms.fields.CharField object>, 'placeholder': <django.forms.fields.CharField object>, 'readonly_value': <django.forms.fields.BooleanField object>, 'required': <django.forms.fields.BooleanField object>, 'step_value': <django.forms.fields.IntegerField object>, 'type_value': <django.forms.fields.ChoiceField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- 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')]¶
- class fobi.contrib.plugins.form_elements.fields.integer.base.IntegerInputPlugin(user=None)[source]¶
Bases:
fobi.base.FormFieldPlugin
Integer input plugin.
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Fields'¶
- name = 'Integer'¶
- uid = 'integer'¶
- class fobi.contrib.plugins.form_elements.fields.integer.fobi_form_elements.IntegerInputPlugin(user=None)[source]¶
Bases:
fobi.base.FormFieldPlugin
Integer input plugin.
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Fields'¶
- name = 'Integer'¶
- uid = 'integer'¶
- class fobi.contrib.plugins.form_elements.fields.integer.forms.IntegerInputForm(data=None, files=None, auto_id='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, renderer=None)[source]¶
Bases:
django.forms.forms.Form
,fobi.base.BaseFormFieldPluginForm
Form for
IntegerInputPlugin
.- base_fields = {'help_text': <django.forms.fields.CharField object>, 'initial': <django.forms.fields.IntegerField object>, 'label': <django.forms.fields.CharField object>, 'max_value': <django.forms.fields.IntegerField object>, 'min_value': <django.forms.fields.IntegerField object>, 'name': <django.forms.fields.CharField object>, 'placeholder': <django.forms.fields.CharField object>, 'required': <django.forms.fields.BooleanField object>}¶
- declared_fields = {'help_text': <django.forms.fields.CharField object>, 'initial': <django.forms.fields.IntegerField object>, 'label': <django.forms.fields.CharField object>, 'max_value': <django.forms.fields.IntegerField object>, 'min_value': <django.forms.fields.IntegerField object>, 'name': <django.forms.fields.CharField object>, 'placeholder': <django.forms.fields.CharField object>, 'required': <django.forms.fields.BooleanField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- plugin_data_fields = [('label', ''), ('name', ''), ('help_text', ''), ('initial', ''), ('min_value', None), ('max_value', None), ('required', False), ('placeholder', '')]¶
- class fobi.contrib.plugins.form_elements.fields.ip_address.base.IPAddressInputPlugin(user=None)[source]¶
Bases:
fobi.base.FormFieldPlugin
IP address field plugin.
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Fields'¶
- name = 'IP address'¶
- uid = 'ip_address'¶
- class fobi.contrib.plugins.form_elements.fields.ip_address.fobi_form_elements.IPAddressInputPlugin(user=None)[source]¶
Bases:
fobi.base.FormFieldPlugin
IP address field plugin.
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Fields'¶
- name = 'IP address'¶
- uid = 'ip_address'¶
- class fobi.contrib.plugins.form_elements.fields.ip_address.forms.IPAddressInputForm(data=None, files=None, auto_id='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, renderer=None)[source]¶
Bases:
django.forms.forms.Form
,fobi.base.BaseFormFieldPluginForm
Form for
IPAddressInputPlugin
.- base_fields = {'help_text': <django.forms.fields.CharField object>, 'initial': <django.forms.fields.CharField object>, 'label': <django.forms.fields.CharField object>, 'max_length': <django.forms.fields.IntegerField object>, 'name': <django.forms.fields.CharField object>, 'placeholder': <django.forms.fields.CharField object>, 'protocol': <django.forms.fields.ChoiceField object>, 'required': <django.forms.fields.BooleanField object>, 'unpack_ipv4': <django.forms.fields.BooleanField object>}¶
- clean()[source]¶
Hook for doing any extra form-wide cleaning after Field.clean() has been called on every field. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field named ‘__all__’.
- declared_fields = {'help_text': <django.forms.fields.CharField object>, 'initial': <django.forms.fields.CharField object>, 'label': <django.forms.fields.CharField object>, 'max_length': <django.forms.fields.IntegerField object>, 'name': <django.forms.fields.CharField object>, 'placeholder': <django.forms.fields.CharField object>, 'protocol': <django.forms.fields.ChoiceField object>, 'required': <django.forms.fields.BooleanField object>, 'unpack_ipv4': <django.forms.fields.BooleanField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- plugin_data_fields = [('label', ''), ('name', ''), ('help_text', ''), ('initial', ''), ('protocol', ''), ('unpack_ipv4', False), ('max_length', '255'), ('required', False), ('placeholder', '')]¶
- class fobi.contrib.plugins.form_elements.fields.null_boolean.base.NullBooleanSelectPlugin(user=None)[source]¶
Bases:
fobi.base.FormFieldPlugin
Null boolean select plugin.
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Fields'¶
- name = 'Null boolean'¶
- uid = 'null_boolean'¶
- class fobi.contrib.plugins.form_elements.fields.null_boolean.fobi_form_elements.NullBooleanSelectPlugin(user=None)[source]¶
Bases:
fobi.base.FormFieldPlugin
Null boolean select plugin.
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Fields'¶
- name = 'Null boolean'¶
- uid = 'null_boolean'¶
- class fobi.contrib.plugins.form_elements.fields.null_boolean.forms.NullBooleanSelectForm(data=None, files=None, auto_id='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, renderer=None)[source]¶
Bases:
django.forms.forms.Form
,fobi.base.BaseFormFieldPluginForm
Form for
NullBooleanSelectPlugin
.- base_fields = {'help_text': <django.forms.fields.CharField object>, 'initial': <django.forms.fields.NullBooleanField object>, 'label': <django.forms.fields.CharField object>, 'name': <django.forms.fields.CharField object>, 'required': <django.forms.fields.BooleanField object>}¶
- declared_fields = {'help_text': <django.forms.fields.CharField object>, 'initial': <django.forms.fields.NullBooleanField object>, 'label': <django.forms.fields.CharField object>, 'name': <django.forms.fields.CharField object>, 'required': <django.forms.fields.BooleanField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- plugin_data_fields = [('label', ''), ('name', ''), ('help_text', ''), ('initial', ''), ('required', False)]¶
- class fobi.contrib.plugins.form_elements.fields.password.base.PasswordInputPlugin(user=None)[source]¶
Bases:
fobi.base.FormFieldPlugin
Password field plugin.
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Fields'¶
- name = 'Password'¶
- uid = 'password'¶
- class fobi.contrib.plugins.form_elements.fields.password.fobi_form_elements.PasswordInputPlugin(user=None)[source]¶
Bases:
fobi.base.FormFieldPlugin
Password field plugin.
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Fields'¶
- name = 'Password'¶
- uid = 'password'¶
- class fobi.contrib.plugins.form_elements.fields.password.forms.PasswordInputForm(data=None, files=None, auto_id='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, renderer=None)[source]¶
Bases:
django.forms.forms.Form
,fobi.base.BaseFormFieldPluginForm
Form for
PasswordInputPlugin
.- base_fields = {'help_text': <django.forms.fields.CharField object>, 'initial': <django.forms.fields.CharField object>, 'label': <django.forms.fields.CharField object>, 'max_length': <django.forms.fields.IntegerField object>, 'name': <django.forms.fields.CharField object>, 'placeholder': <django.forms.fields.CharField object>, 'required': <django.forms.fields.BooleanField object>}¶
- clean()[source]¶
Hook for doing any extra form-wide cleaning after Field.clean() has been called on every field. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field named ‘__all__’.
- declared_fields = {'help_text': <django.forms.fields.CharField object>, 'initial': <django.forms.fields.CharField object>, 'label': <django.forms.fields.CharField object>, 'max_length': <django.forms.fields.IntegerField object>, 'name': <django.forms.fields.CharField object>, 'placeholder': <django.forms.fields.CharField object>, 'required': <django.forms.fields.BooleanField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- plugin_data_fields = [('label', ''), ('name', ''), ('help_text', ''), ('initial', ''), ('max_length', '255'), ('required', False), ('placeholder', '')]¶
- class fobi.contrib.plugins.form_elements.fields.radio.base.RadioInputPlugin(user=None)[source]¶
Bases:
fobi.base.FormFieldPlugin
Radio field plugin.
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Fields'¶
- name = 'Radio'¶
- 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.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.
- class fobi.contrib.plugins.form_elements.fields.radio.fobi_form_elements.RadioInputPlugin(user=None)[source]¶
Bases:
fobi.base.FormFieldPlugin
Radio field plugin.
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Fields'¶
- name = 'Radio'¶
- 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'¶
- class fobi.contrib.plugins.form_elements.fields.radio.forms.RadioInputForm(data=None, files=None, auto_id='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, renderer=None)[source]¶
Bases:
django.forms.forms.Form
,fobi.base.BaseFormFieldPluginForm
Form for
RadioInputPlugin
.- base_fields = {'choices': <django.forms.fields.CharField object>, 'help_text': <django.forms.fields.CharField object>, 'initial': <django.forms.fields.CharField object>, 'label': <django.forms.fields.CharField object>, 'name': <django.forms.fields.CharField object>, 'required': <django.forms.fields.BooleanField object>}¶
- declared_fields = {'choices': <django.forms.fields.CharField object>, 'help_text': <django.forms.fields.CharField object>, 'initial': <django.forms.fields.CharField object>, 'label': <django.forms.fields.CharField object>, 'name': <django.forms.fields.CharField object>, 'required': <django.forms.fields.BooleanField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- plugin_data_fields = [('label', ''), ('name', ''), ('choices', ''), ('help_text', ''), ('initial', ''), ('required', False)]¶
- class fobi.contrib.plugins.form_elements.fields.range_select.base.RangeSelectInputPlugin(user=None)[source]¶
Bases:
fobi.base.FormFieldPlugin
Range select input plugin.
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Fields'¶
- name = 'Range select'¶
- uid = 'range_select'¶
- 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.
- class fobi.contrib.plugins.form_elements.fields.range_select.fobi_form_elements.RangeSelectInputPlugin(user=None)[source]¶
Bases:
fobi.base.FormFieldPlugin
Range select input plugin.
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Fields'¶
- name = 'Range select'¶
- uid = 'range_select'¶
- class fobi.contrib.plugins.form_elements.fields.range_select.forms.RangeSelectInputForm(data=None, files=None, auto_id='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, renderer=None)[source]¶
Bases:
django.forms.forms.Form
,fobi.base.BaseFormFieldPluginForm
Form for
RangeSelectInputPlugin
.- base_fields = {'help_text': <django.forms.fields.CharField object>, 'initial': <django.forms.fields.IntegerField object>, 'label': <django.forms.fields.CharField object>, 'max_value': <django.forms.fields.IntegerField object>, 'min_value': <django.forms.fields.IntegerField object>, 'name': <django.forms.fields.CharField object>, 'required': <django.forms.fields.BooleanField object>, 'step': <django.forms.fields.IntegerField object>}¶
- declared_fields = {'help_text': <django.forms.fields.CharField object>, 'initial': <django.forms.fields.IntegerField object>, 'label': <django.forms.fields.CharField object>, 'max_value': <django.forms.fields.IntegerField object>, 'min_value': <django.forms.fields.IntegerField object>, 'name': <django.forms.fields.CharField object>, 'required': <django.forms.fields.BooleanField object>, 'step': <django.forms.fields.IntegerField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- plugin_data_fields = [('label', ''), ('name', ''), ('min_value', 0), ('max_value', 100), ('step', 1), ('help_text', ''), ('initial', 50), ('required', False)]¶
- class fobi.contrib.plugins.form_elements.fields.regex.base.RegexInputPlugin(user=None)[source]¶
Bases:
fobi.base.FormFieldPlugin
Regex field plugin.
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Fields'¶
- name = 'Regex'¶
- uid = 'regex'¶
- class fobi.contrib.plugins.form_elements.fields.regex.fobi_form_elements.RegexInputPlugin(user=None)[source]¶
Bases:
fobi.base.FormFieldPlugin
Regex field plugin.
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Fields'¶
- name = 'Regex'¶
- uid = 'regex'¶
- class fobi.contrib.plugins.form_elements.fields.regex.forms.RegexInputForm(data=None, files=None, auto_id='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, renderer=None)[source]¶
Bases:
django.forms.forms.Form
,fobi.base.BaseFormFieldPluginForm
Form for
RegexInputPlugin
.- base_fields = {'help_text': <django.forms.fields.CharField object>, 'initial': <django.forms.fields.CharField object>, 'label': <django.forms.fields.CharField object>, 'max_length': <django.forms.fields.IntegerField object>, 'name': <django.forms.fields.CharField object>, 'placeholder': <django.forms.fields.CharField object>, 'regex': <django.forms.fields.RegexField object>, 'required': <django.forms.fields.BooleanField object>}¶
- declared_fields = {'help_text': <django.forms.fields.CharField object>, 'initial': <django.forms.fields.CharField object>, 'label': <django.forms.fields.CharField object>, 'max_length': <django.forms.fields.IntegerField object>, 'name': <django.forms.fields.CharField object>, 'placeholder': <django.forms.fields.CharField object>, 'regex': <django.forms.fields.RegexField object>, 'required': <django.forms.fields.BooleanField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- plugin_data_fields = [('label', ''), ('name', ''), ('help_text', ''), ('initial', ''), ('regex', ''), ('max_length', '255'), ('required', False), ('placeholder', '')]¶
- class fobi.contrib.plugins.form_elements.fields.select.base.SelectInputPlugin(user=None)[source]¶
Bases:
fobi.base.FormFieldPlugin
Select field plugin.
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Fields'¶
- name = 'Select'¶
- 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.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.
- class fobi.contrib.plugins.form_elements.fields.select.fobi_form_elements.SelectInputPlugin(user=None)[source]¶
Bases:
fobi.base.FormFieldPlugin
Select field plugin.
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Fields'¶
- name = 'Select'¶
- 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'¶
- class fobi.contrib.plugins.form_elements.fields.select.forms.SelectInputForm(data=None, files=None, auto_id='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, renderer=None)[source]¶
Bases:
django.forms.forms.Form
,fobi.base.BaseFormFieldPluginForm
Form for
SelectInputPlugin
.- base_fields = {'choices': <django.forms.fields.CharField object>, 'help_text': <django.forms.fields.CharField object>, 'initial': <django.forms.fields.CharField object>, 'label': <django.forms.fields.CharField object>, 'name': <django.forms.fields.CharField object>, 'required': <django.forms.fields.BooleanField object>}¶
- declared_fields = {'choices': <django.forms.fields.CharField object>, 'help_text': <django.forms.fields.CharField object>, 'initial': <django.forms.fields.CharField object>, 'label': <django.forms.fields.CharField object>, 'name': <django.forms.fields.CharField object>, 'required': <django.forms.fields.BooleanField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- plugin_data_fields = [('label', ''), ('name', ''), ('choices', ''), ('help_text', ''), ('initial', ''), ('required', False)]¶
- 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
fobi.contrib.plugins.form_elements.fields.select_model_object.forms.SelectModelObjectInputForm
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Fields'¶
- name = 'Select model 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.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.
- 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
fobi.contrib.plugins.form_elements.fields.select_model_object.forms.SelectModelObjectInputForm
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Fields'¶
- name = 'Select model 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'¶
- 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 = {'help_text': <django.forms.fields.CharField object>, 'initial': <django.forms.fields.CharField object>, 'label': <django.forms.fields.CharField object>, 'model': <django.forms.fields.ChoiceField object>, 'name': <django.forms.fields.CharField object>, 'required': <django.forms.fields.BooleanField object>}¶
- declared_fields = {'help_text': <django.forms.fields.CharField object>, 'initial': <django.forms.fields.CharField object>, 'label': <django.forms.fields.CharField object>, 'model': <django.forms.fields.ChoiceField object>, 'name': <django.forms.fields.CharField object>, 'required': <django.forms.fields.BooleanField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- plugin_data_fields = [('label', ''), ('name', ''), ('model', ''), ('help_text', ''), ('initial', ''), ('required', False)]¶
- 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'¶
- class fobi.contrib.plugins.form_elements.fields.select_mptt_model_object.base.SelectMPTTModelObjectInputPlugin(user=None)[source]¶
Bases:
fobi.base.FormFieldPlugin
Select MPTT model object field plugin.
- form¶
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Fields'¶
- name = 'Select MPTT model 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_mptt_model_object'¶
- 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.
- class fobi.contrib.plugins.form_elements.fields.select_mptt_model_object.fobi_form_elements.SelectMPTTModelObjectInputPlugin(user=None)[source]¶
Bases:
fobi.base.FormFieldPlugin
Select MPTT model object field plugin.
- form¶
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Fields'¶
- name = 'Select MPTT model 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_mptt_model_object'¶
- 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 = {'help_text': <django.forms.fields.CharField object>, 'initial': <django.forms.fields.CharField object>, 'label': <django.forms.fields.CharField object>, 'model': <django.forms.fields.ChoiceField object>, 'name': <django.forms.fields.CharField object>, 'required': <django.forms.fields.BooleanField object>}¶
- declared_fields = {'help_text': <django.forms.fields.CharField object>, 'initial': <django.forms.fields.CharField object>, 'label': <django.forms.fields.CharField object>, 'model': <django.forms.fields.ChoiceField object>, 'name': <django.forms.fields.CharField object>, 'required': <django.forms.fields.BooleanField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- plugin_data_fields = [('label', ''), ('name', ''), ('model', ''), ('help_text', ''), ('initial', ''), ('required', False)]¶
- 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
fobi.contrib.plugins.form_elements.fields.select_multiple.forms.SelectMultipleInputForm
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Fields'¶
- name = 'Select multiple'¶
- 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.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.
- 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
fobi.contrib.plugins.form_elements.fields.select_multiple.forms.SelectMultipleInputForm
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Fields'¶
- name = 'Select multiple'¶
- 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'¶
- class fobi.contrib.plugins.form_elements.fields.select_multiple.forms.SelectMultipleInputForm(data=None, files=None, auto_id='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, renderer=None)[source]¶
Bases:
django.forms.forms.Form
,fobi.base.BaseFormFieldPluginForm
Form for
SelectMultipleInputPlugin
.- base_fields = {'choices': <django.forms.fields.CharField object>, 'help_text': <django.forms.fields.CharField object>, 'initial': <django.forms.fields.CharField object>, 'label': <django.forms.fields.CharField object>, 'name': <django.forms.fields.CharField object>, 'required': <django.forms.fields.BooleanField object>}¶
- declared_fields = {'choices': <django.forms.fields.CharField object>, 'help_text': <django.forms.fields.CharField object>, 'initial': <django.forms.fields.CharField object>, 'label': <django.forms.fields.CharField object>, 'name': <django.forms.fields.CharField object>, 'required': <django.forms.fields.BooleanField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- plugin_data_fields = [('label', ''), ('name', ''), ('choices', ''), ('help_text', ''), ('initial', ''), ('required', False)]¶
- 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'¶
- 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¶
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Fields'¶
- name = 'Select multiple model objects'¶
- 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.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.
- 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¶
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Fields'¶
- name = 'Select multiple model objects'¶
- 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'¶
- 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 = {'help_text': <django.forms.fields.CharField object>, 'initial': <django.forms.fields.CharField object>, 'label': <django.forms.fields.CharField object>, 'model': <django.forms.fields.ChoiceField object>, 'name': <django.forms.fields.CharField object>, 'required': <django.forms.fields.BooleanField object>}¶
- declared_fields = {'help_text': <django.forms.fields.CharField object>, 'initial': <django.forms.fields.CharField object>, 'label': <django.forms.fields.CharField object>, 'model': <django.forms.fields.ChoiceField object>, 'name': <django.forms.fields.CharField object>, 'required': <django.forms.fields.BooleanField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- plugin_data_fields = [('label', ''), ('name', ''), ('model', ''), ('help_text', ''), ('initial', ''), ('required', False)]¶
- 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'¶
- class fobi.contrib.plugins.form_elements.fields.select_multiple_mptt_model_objects.base.SelectMultipleMPTTModelObjectsInputPlugin(user=None)[source]¶
Bases:
fobi.base.FormFieldPlugin
Select multiple MPTT model object field plugin.
- form¶
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Fields'¶
- name = 'Select multiple MPTT model objects'¶
- 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_mptt_model_objects'¶
- 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.
- class fobi.contrib.plugins.form_elements.fields.select_multiple_mptt_model_objects.fobi_form_elements.SelectMultipleMPTTModelObjectsInputPlugin(user=None)[source]¶
Bases:
fobi.base.FormFieldPlugin
Select multiple MPTT model object field plugin.
- form¶
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Fields'¶
- name = 'Select multiple MPTT model objects'¶
- 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_mptt_model_objects'¶
- 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 = {'help_text': <django.forms.fields.CharField object>, 'initial': <django.forms.fields.CharField object>, 'label': <django.forms.fields.CharField object>, 'model': <django.forms.fields.ChoiceField object>, 'name': <django.forms.fields.CharField object>, 'required': <django.forms.fields.BooleanField object>}¶
- declared_fields = {'help_text': <django.forms.fields.CharField object>, 'initial': <django.forms.fields.CharField object>, 'label': <django.forms.fields.CharField object>, 'model': <django.forms.fields.ChoiceField object>, 'name': <django.forms.fields.CharField object>, 'required': <django.forms.fields.BooleanField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- plugin_data_fields = [('label', ''), ('name', ''), ('model', ''), ('help_text', ''), ('initial', ''), ('required', False)]¶
- 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'¶
- 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¶
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Fields'¶
- name = 'Select multiple with max'¶
- 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.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.
- 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.
- 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¶
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Fields'¶
- name = 'Select multiple with max'¶
- 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'¶
- class fobi.contrib.plugins.form_elements.fields.select_multiple_with_max.forms.SelectMultipleWithMaxInputForm(data=None, files=None, auto_id='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, renderer=None)[source]¶
Bases:
django.forms.forms.Form
,fobi.base.BaseFormFieldPluginForm
Form for
SelectMultipleWithMaxInputPlugin
.- base_fields = {'choices': <django.forms.fields.CharField object>, 'help_text': <django.forms.fields.CharField object>, 'initial': <django.forms.fields.CharField object>, 'label': <django.forms.fields.CharField object>, 'max_choices': <django.forms.fields.IntegerField object>, 'name': <django.forms.fields.CharField object>, 'required': <django.forms.fields.BooleanField object>}¶
- declared_fields = {'choices': <django.forms.fields.CharField object>, 'help_text': <django.forms.fields.CharField object>, 'initial': <django.forms.fields.CharField object>, 'label': <django.forms.fields.CharField object>, 'max_choices': <django.forms.fields.IntegerField object>, 'name': <django.forms.fields.CharField object>, 'required': <django.forms.fields.BooleanField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- plugin_data_fields = [('label', ''), ('name', ''), ('choices', ''), ('help_text', ''), ('initial', ''), ('required', False), ('max_choices', '')]¶
- class fobi.contrib.plugins.form_elements.fields.slider.base.SliderInputPlugin(user=None)[source]¶
Bases:
fobi.base.FormFieldPlugin
Slider field plugin.
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Fields'¶
- html_classes = ['slider']¶
- name = 'Slider'¶
- uid = 'slider'¶
- 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.
- class fobi.contrib.plugins.form_elements.fields.slider.fobi_form_elements.SliderInputPlugin(user=None)[source]¶
Bases:
fobi.base.FormFieldPlugin
Slider field plugin.
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Fields'¶
- html_classes = ['slider']¶
- name = 'Slider'¶
- uid = 'slider'¶
- class fobi.contrib.plugins.form_elements.fields.slider.forms.SliderInputForm(data=None, files=None, auto_id='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, renderer=None)[source]¶
Bases:
django.forms.forms.Form
,fobi.base.BaseFormFieldPluginForm
Form for
SliderInputPlugin
.- base_fields = {'custom_ticks': <django.forms.fields.CharField object>, 'handle': <django.forms.fields.ChoiceField object>, 'help_text': <django.forms.fields.CharField object>, 'initial': <django.forms.fields.IntegerField object>, 'label': <django.forms.fields.CharField object>, 'label_end': <django.forms.fields.CharField object>, 'label_start': <django.forms.fields.CharField object>, 'max_value': <django.forms.fields.IntegerField object>, 'min_value': <django.forms.fields.IntegerField object>, 'name': <django.forms.fields.CharField object>, 'required': <django.forms.fields.BooleanField object>, 'show_endpoints_as': <django.forms.fields.ChoiceField object>, 'step': <django.forms.fields.IntegerField object>, 'tooltip': <django.forms.fields.ChoiceField object>}¶
- declared_fields = {'custom_ticks': <django.forms.fields.CharField object>, 'handle': <django.forms.fields.ChoiceField object>, 'help_text': <django.forms.fields.CharField object>, 'initial': <django.forms.fields.IntegerField object>, 'label': <django.forms.fields.CharField object>, 'label_end': <django.forms.fields.CharField object>, 'label_start': <django.forms.fields.CharField object>, 'max_value': <django.forms.fields.IntegerField object>, 'min_value': <django.forms.fields.IntegerField object>, 'name': <django.forms.fields.CharField object>, 'required': <django.forms.fields.BooleanField object>, 'show_endpoints_as': <django.forms.fields.ChoiceField object>, 'step': <django.forms.fields.IntegerField object>, 'tooltip': <django.forms.fields.ChoiceField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- 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)]¶
- 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'¶
- class fobi.contrib.plugins.form_elements.fields.slug.base.SlugInputPlugin(user=None)[source]¶
Bases:
fobi.base.FormFieldPlugin
Slug field plugin.
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Fields'¶
- name = 'Slug'¶
- uid = 'slug'¶
- class fobi.contrib.plugins.form_elements.fields.slug.fobi_form_elements.SlugInputPlugin(user=None)[source]¶
Bases:
fobi.base.FormFieldPlugin
Slug field plugin.
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Fields'¶
- name = 'Slug'¶
- uid = 'slug'¶
- class fobi.contrib.plugins.form_elements.fields.slug.forms.SlugInputForm(data=None, files=None, auto_id='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, renderer=None)[source]¶
Bases:
django.forms.forms.Form
,fobi.base.BaseFormFieldPluginForm
Form for
SlugInputPlugin
.- base_fields = {'help_text': <django.forms.fields.CharField object>, 'initial': <django.forms.fields.SlugField object>, 'label': <django.forms.fields.CharField object>, 'max_length': <django.forms.fields.IntegerField object>, 'name': <django.forms.fields.CharField object>, 'placeholder': <django.forms.fields.CharField object>, 'required': <django.forms.fields.BooleanField object>}¶
- clean()[source]¶
Hook for doing any extra form-wide cleaning after Field.clean() has been called on every field. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field named ‘__all__’.
- declared_fields = {'help_text': <django.forms.fields.CharField object>, 'initial': <django.forms.fields.SlugField object>, 'label': <django.forms.fields.CharField object>, 'max_length': <django.forms.fields.IntegerField object>, 'name': <django.forms.fields.CharField object>, 'placeholder': <django.forms.fields.CharField object>, 'required': <django.forms.fields.BooleanField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- plugin_data_fields = [('label', ''), ('name', ''), ('help_text', ''), ('initial', ''), ('max_length', '255'), ('required', False), ('placeholder', '')]¶
- class fobi.contrib.plugins.form_elements.fields.text.base.TextInputPlugin(user=None)[source]¶
Bases:
fobi.base.FormFieldPlugin
Text field plugin.
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Fields'¶
- name = 'Text'¶
- uid = 'text'¶
- class fobi.contrib.plugins.form_elements.fields.text.fobi_form_elements.TextInputPlugin(user=None)[source]¶
Bases:
fobi.base.FormFieldPlugin
Text field plugin.
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Fields'¶
- name = 'Text'¶
- uid = 'text'¶
- class fobi.contrib.plugins.form_elements.fields.text.forms.TextInputForm(data=None, files=None, auto_id='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, renderer=None)[source]¶
Bases:
django.forms.forms.Form
,fobi.base.BaseFormFieldPluginForm
Form for
TextInputPlugin
.- base_fields = {'help_text': <django.forms.fields.CharField object>, 'initial': <django.forms.fields.CharField object>, 'label': <django.forms.fields.CharField object>, 'max_length': <django.forms.fields.IntegerField object>, 'name': <django.forms.fields.CharField object>, 'placeholder': <django.forms.fields.CharField object>, 'required': <django.forms.fields.BooleanField object>}¶
- declared_fields = {'help_text': <django.forms.fields.CharField object>, 'initial': <django.forms.fields.CharField object>, 'label': <django.forms.fields.CharField object>, 'max_length': <django.forms.fields.IntegerField object>, 'name': <django.forms.fields.CharField object>, 'placeholder': <django.forms.fields.CharField object>, 'required': <django.forms.fields.BooleanField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- plugin_data_fields = [('label', ''), ('name', ''), ('help_text', ''), ('initial', ''), ('max_length', '255'), ('required', False), ('placeholder', '')]¶
- class fobi.contrib.plugins.form_elements.fields.textarea.base.TextareaPlugin(user=None)[source]¶
Bases:
fobi.base.FormFieldPlugin
Textarea field plugin.
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Fields'¶
- name = 'Textarea'¶
- uid = 'textarea'¶
- class fobi.contrib.plugins.form_elements.fields.textarea.fobi_form_elements.TextareaPlugin(user=None)[source]¶
Bases:
fobi.base.FormFieldPlugin
Textarea field plugin.
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Fields'¶
- name = 'Textarea'¶
- uid = 'textarea'¶
- class fobi.contrib.plugins.form_elements.fields.textarea.forms.TextareaForm(data=None, files=None, auto_id='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, renderer=None)[source]¶
Bases:
django.forms.forms.Form
,fobi.base.BaseFormFieldPluginForm
Form for
TextareaPlugin
.- base_fields = {'help_text': <django.forms.fields.CharField object>, 'initial': <django.forms.fields.CharField object>, 'label': <django.forms.fields.CharField object>, 'max_length': <django.forms.fields.IntegerField object>, 'name': <django.forms.fields.CharField object>, 'placeholder': <django.forms.fields.CharField object>, 'required': <django.forms.fields.BooleanField object>}¶
- declared_fields = {'help_text': <django.forms.fields.CharField object>, 'initial': <django.forms.fields.CharField object>, 'label': <django.forms.fields.CharField object>, 'max_length': <django.forms.fields.IntegerField object>, 'name': <django.forms.fields.CharField object>, 'placeholder': <django.forms.fields.CharField object>, 'required': <django.forms.fields.BooleanField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- plugin_data_fields = [('label', ''), ('name', ''), ('help_text', ''), ('initial', ''), ('required', False), ('max_length', ''), ('placeholder', '')]¶
- class fobi.contrib.plugins.form_elements.fields.time.base.TimeInputPlugin(user=None)[source]¶
Bases:
fobi.base.FormFieldPlugin
Time field plugin.
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Fields'¶
- name = 'Time'¶
- 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'¶
- class fobi.contrib.plugins.form_elements.fields.time.fobi_form_elements.TimeInputPlugin(user=None)[source]¶
Bases:
fobi.base.FormFieldPlugin
Time field plugin.
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Fields'¶
- name = 'Time'¶
- 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'¶
- class fobi.contrib.plugins.form_elements.fields.time.forms.TimeInputForm(data=None, files=None, auto_id='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, renderer=None)[source]¶
Bases:
django.forms.forms.Form
,fobi.base.BaseFormFieldPluginForm
Form for
TimeInputPlugin
.- base_fields = {'help_text': <django.forms.fields.CharField object>, 'initial': <django.forms.fields.TimeField object>, 'input_formats': <django.forms.fields.CharField object>, 'label': <django.forms.fields.CharField object>, 'name': <django.forms.fields.CharField object>, 'required': <django.forms.fields.BooleanField object>}¶
- declared_fields = {'help_text': <django.forms.fields.CharField object>, 'initial': <django.forms.fields.TimeField object>, 'input_formats': <django.forms.fields.CharField object>, 'label': <django.forms.fields.CharField object>, 'name': <django.forms.fields.CharField object>, 'required': <django.forms.fields.BooleanField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- plugin_data_fields = [('label', ''), ('name', ''), ('help_text', ''), ('initial', ''), ('input_formats', ''), ('required', False)]¶
- class fobi.contrib.plugins.form_elements.fields.url.base.URLInputPlugin(user=None)[source]¶
Bases:
fobi.base.FormFieldPlugin
URL input plugin.
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Fields'¶
- name = 'URL'¶
- uid = 'url'¶
- class fobi.contrib.plugins.form_elements.fields.url.fobi_form_elements.URLInputPlugin(user=None)[source]¶
Bases:
fobi.base.FormFieldPlugin
URL input plugin.
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Fields'¶
- name = 'URL'¶
- uid = 'url'¶
- class fobi.contrib.plugins.form_elements.fields.url.forms.URLInputForm(data=None, files=None, auto_id='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, renderer=None)[source]¶
Bases:
django.forms.forms.Form
,fobi.base.BaseFormFieldPluginForm
Form for
URLPlugin
.- base_fields = {'help_text': <django.forms.fields.CharField object>, 'initial': <django.forms.fields.URLField object>, 'label': <django.forms.fields.CharField object>, 'max_length': <django.forms.fields.IntegerField object>, 'name': <django.forms.fields.CharField object>, 'placeholder': <django.forms.fields.CharField object>, 'required': <django.forms.fields.BooleanField object>}¶
- clean()[source]¶
Hook for doing any extra form-wide cleaning after Field.clean() has been called on every field. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field named ‘__all__’.
- declared_fields = {'help_text': <django.forms.fields.CharField object>, 'initial': <django.forms.fields.URLField object>, 'label': <django.forms.fields.CharField object>, 'max_length': <django.forms.fields.IntegerField object>, 'name': <django.forms.fields.CharField object>, 'placeholder': <django.forms.fields.CharField object>, 'required': <django.forms.fields.BooleanField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- plugin_data_fields = [('label', ''), ('name', ''), ('help_text', ''), ('initial', ''), ('max_length', '255'), ('required', False), ('placeholder', '')]¶
- class fobi.contrib.plugins.form_elements.security.captcha.base.CaptchaInputPlugin(user=None)[source]¶
Bases:
fobi.base.FormElementPlugin
Captcha field plugin.
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Security'¶
- name = 'Captcha'¶
- uid = 'captcha'¶
- class fobi.contrib.plugins.form_elements.security.captcha.fobi_form_elements.CaptchaInputPlugin(user=None)[source]¶
Bases:
fobi.base.FormElementPlugin
Captcha field plugin.
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Security'¶
- name = 'Captcha'¶
- uid = 'captcha'¶
- class fobi.contrib.plugins.form_elements.security.captcha.forms.CaptchaInputForm(data=None, files=None, auto_id='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, renderer=None)[source]¶
Bases:
django.forms.forms.Form
,fobi.base.BaseFormFieldPluginForm
Form for
CaptchaInputPlugin
.- base_fields = {'help_text': <django.forms.fields.CharField object>, 'label': <django.forms.fields.CharField object>, 'name': <django.forms.fields.CharField object>, 'required': <django.forms.fields.BooleanField object>}¶
- declared_fields = {'help_text': <django.forms.fields.CharField object>, 'label': <django.forms.fields.CharField object>, 'name': <django.forms.fields.CharField object>, 'required': <django.forms.fields.BooleanField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- plugin_data_fields = [('label', ''), ('name', ''), ('help_text', ''), ('required', True)]¶
- class fobi.contrib.plugins.form_elements.security.honeypot.base.HoneypotInputPlugin(user=None)[source]¶
Bases:
fobi.base.FormElementPlugin
Honeypot field plugin.
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Security'¶
- name = 'Honeypot'¶
- uid = 'honeypot'¶
- 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.
- class fobi.contrib.plugins.form_elements.security.honeypot.fields.HoneypotField(*, max_length=None, min_length=None, strip=True, empty_value='', **kwargs)[source]¶
Bases:
django.forms.fields.CharField
- default_error_messages = {'invalid': 'Field value was tampered with.'}¶
- widget¶
alias of
django.forms.widgets.HiddenInput
- class fobi.contrib.plugins.form_elements.security.honeypot.fobi_form_elements.HoneypotInputPlugin(user=None)[source]¶
Bases:
fobi.base.FormElementPlugin
Honeypot field plugin.
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Security'¶
- name = 'Honeypot'¶
- uid = 'honeypot'¶
- class fobi.contrib.plugins.form_elements.security.honeypot.forms.HoneypotInputForm(data=None, files=None, auto_id='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, renderer=None)[source]¶
Bases:
django.forms.forms.Form
,fobi.base.BaseFormFieldPluginForm
Form for
HoneypotInputPlugin
.- base_fields = {'initial': <django.forms.fields.CharField object>, 'label': <django.forms.fields.CharField object>, 'max_length': <django.forms.fields.IntegerField object>, 'name': <django.forms.fields.CharField object>, 'required': <django.forms.fields.BooleanField object>}¶
- declared_fields = {'initial': <django.forms.fields.CharField object>, 'label': <django.forms.fields.CharField object>, 'max_length': <django.forms.fields.IntegerField object>, 'name': <django.forms.fields.CharField object>, 'required': <django.forms.fields.BooleanField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- plugin_data_fields = [('label', ''), ('name', ''), ('initial', ''), ('max_length', '255'), ('required', True)]¶
HONEYPOT_VALUE
(string)
- class fobi.contrib.plugins.form_elements.security.recaptcha.base.ReCaptchaInputPlugin(user=None)[source]¶
Bases:
fobi.base.FormElementPlugin
ReCaptcha field plugin.
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Security'¶
- name = 'ReCaptcha'¶
- uid = 'recaptcha'¶
- class fobi.contrib.plugins.form_elements.security.recaptcha.fobi_form_elements.ReCaptchaInputPlugin(user=None)[source]¶
Bases:
fobi.base.FormElementPlugin
ReCaptcha field plugin.
- get_form_field_instances(request=None, form_entry=None, form_element_entries=None, **kwargs)[source]¶
Get form field instances.
- group = 'Security'¶
- name = 'ReCaptcha'¶
- uid = 'recaptcha'¶
- class fobi.contrib.plugins.form_elements.security.recaptcha.forms.ReCaptchaInputForm(data=None, files=None, auto_id='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, renderer=None)[source]¶
Bases:
django.forms.forms.Form
,fobi.base.BaseFormFieldPluginForm
Form for
ReCaptchaInputPlugin
.- base_fields = {'help_text': <django.forms.fields.CharField object>, 'label': <django.forms.fields.CharField object>, 'name': <django.forms.fields.CharField object>, 'required': <django.forms.fields.BooleanField object>}¶
- declared_fields = {'help_text': <django.forms.fields.CharField object>, 'label': <django.forms.fields.CharField object>, 'name': <django.forms.fields.CharField object>, 'required': <django.forms.fields.BooleanField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- plugin_data_fields = [('label', ''), ('name', ''), ('help_text', ''), ('required', True)]¶
- 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 = 'Testing'¶
- name = 'Dummy'¶
- uid = 'dummy'¶
- 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 = 'Testing'¶
- name = 'Dummy'¶
- uid = 'dummy'¶
- 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'¶
- class fobi.contrib.plugins.form_handlers.db_store.migrations.0001_initial.Migration(name, app_label)[source]¶
Bases:
django.db.migrations.migration.Migration
- dependencies = [('fobi', '0002_auto_20150912_1744'), ('auth', '__first__')]¶
- operations = [<CreateModel name='SavedFormDataEntry', fields=[('id', <django.db.models.fields.AutoField>), ('form_data_headers', <django.db.models.fields.TextField>), ('saved_data', <django.db.models.fields.TextField>), ('created', <django.db.models.fields.DateTimeField>), ('form_entry', <django.db.models.fields.related.ForeignKey>), ('user', <django.db.models.fields.related.ForeignKey>)], options={'verbose_name': 'Saved form data entry', 'abstract': False, 'verbose_name_plural': 'Saved form data entries', 'db_table': 'db_store_savedformdataentry'}>]¶
- class fobi.contrib.plugins.form_handlers.db_store.migrations.0002_savedformwizarddataentry.Migration(name, app_label)[source]¶
Bases:
django.db.migrations.migration.Migration
- dependencies = [('auth', '__first__'), ('fobi', '0010_formwizardhandler'), ('fobi_contrib_plugins_form_handlers_db_store', '0001_initial')]¶
- operations = [<CreateModel name='SavedFormWizardDataEntry', fields=[('id', <django.db.models.fields.AutoField>), ('form_data_headers', <django.db.models.fields.TextField>), ('saved_data', <django.db.models.fields.TextField>), ('created', <django.db.models.fields.DateTimeField>), ('form_wizard_entry', <django.db.models.fields.related.ForeignKey>), ('user', <django.db.models.fields.related.ForeignKey>)], options={'abstract': False, 'db_table': 'db_store_savedformwizarddataentry', 'verbose_name': 'Saved form wizard data entry', 'verbose_name_plural': 'Saved form wizard data entries'}>]¶
- 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.
- actions = ['export_data']¶
- fieldsets = ((None, {'fields': ('form_entry', 'user')}), ('Data', {'fields': ('formatted_saved_data', 'created')}), ('Raw', {'classes': ('collapse',), 'fields': ('form_data_headers', 'saved_data')}))¶
- list_display = ('form_entry', 'user', 'formatted_saved_data', 'created')¶
- list_filter = ('form_entry', 'user')¶
- property media¶
- only_args = ['form_entry']¶
- 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.
- actions = ['export_data']¶
- fieldsets = ((None, {'fields': ('form_wizard_entry', 'user')}), ('Data', {'fields': ('formatted_saved_data', 'created')}), ('Raw', {'classes': ('collapse',), 'fields': ('form_data_headers', 'saved_data')}))¶
- list_display = ('form_wizard_entry', 'user', 'formatted_saved_data', 'created')¶
- list_filter = ('form_wizard_entry', 'user')¶
- property media¶
- only_args = ['form_wizard_entry']¶
- readonly_fields = ('created', 'formatted_saved_data')¶
- 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 = 'DB store'¶
- 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 = 'DB store'¶
- run(form_wizard_entry, request, form_list, form_wizard, form_element_entries=None)[source]¶
Run.
- Parameters
form_wizard_entry (fobi.models.FormWizardEntry) – Instance of
fobi.models.FormWizardEntry
.request (django.http.HttpRequest) –
form_list (list) – List of
django.forms.Form
instances.form_wizard (fobi.wizard.views.dynamic.DynamicWizardView) – Instance of
fobi.wizard.views.dynamic.DynamicWizardView
.form_element_entries (iterable) – Iterable of
fobi.models.FormElementEntry
objects.
- uid = 'db_store'¶
- class fobi.contrib.plugins.form_handlers.db_store.callbacks.AutoFormDbStore[source]¶
Bases:
fobi.base.FormCallback
Auto save form entries.
Note, that this callback is not active. In order to activate it, you should import the
AutoFormDbStore
and register it using the callback register as follows.>>> from fobi.base import form_callback_registry >>> from fobi.contrib.plugins.form_handlers.db_store.callbacks import ( >>> AutoFormDbStore >>> ) >>> form_callback_registry.register(AutoFormDbStore)
- callback(form_entry, request, form)[source]¶
Callback.
- Parameters
form_entry –
request –
form –
- Returns
- stage = 'form_valid'¶
- 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.
- 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 = 'DB store'¶
- 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 = 'DB store'¶
- run(form_wizard_entry, request, form_list, form_wizard, form_element_entries=None)[source]¶
Run.
- Parameters
form_wizard_entry (fobi.models.FormWizardEntry) – Instance of
fobi.models.FormWizardEntry
.request (django.http.HttpRequest) –
form_list (list) – List of
django.forms.Form
instances.form_wizard (fobi.wizard.views.dynamic.DynamicWizardView) – Instance of
fobi.wizard.views.dynamic.DynamicWizardView
.form_element_entries (iterable) – Iterable of
fobi.models.FormElementEntry
objects.
- uid = 'db_store'¶
- class fobi.contrib.plugins.form_handlers.db_store.models.AbstractSavedFormDataEntry(*args, **kwargs)[source]¶
Bases:
django.db.models.base.Model
Abstract saved form data entry.
- created¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- 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.
- get_next_by_created(*, field=<django.db.models.fields.DateTimeField: created>, is_next=True, **kwargs)¶
- get_previous_by_created(*, field=<django.db.models.fields.DateTimeField: created>, is_next=False, **kwargs)¶
- saved_data¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- user¶
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- 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 MultipleObjectsReturned¶
Bases:
django.core.exceptions.MultipleObjectsReturned
- form_entry¶
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- 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.
- get_next_by_created(*, field=<django.db.models.fields.DateTimeField: created>, is_next=True, **kwargs)¶
- get_previous_by_created(*, field=<django.db.models.fields.DateTimeField: created>, is_next=False, **kwargs)¶
- id¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- objects = <django.db.models.manager.Manager object>¶
- user¶
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
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 MultipleObjectsReturned¶
Bases:
django.core.exceptions.MultipleObjectsReturned
- form_wizard_entry¶
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- 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.
- get_next_by_created(*, field=<django.db.models.fields.DateTimeField: created>, is_next=True, **kwargs)¶
- get_previous_by_created(*, field=<django.db.models.fields.DateTimeField: created>, is_next=False, **kwargs)¶
- id¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- objects = <django.db.models.manager.Manager object>¶
- user¶
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
CSV_DELIMITER
(string)CSV_QUOTECHAR
(string)
- fobi.contrib.plugins.form_handlers.db_store.views.export_saved_form_data_entries(request, form_entry_id=None, theme=None)[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.export_saved_form_wizard_data_entries(request, form_wizard_entry_id=None, theme=None)[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.views.view_saved_form_data_entries(request, form_entry_id=None, theme=None, template_name='db_store/view_saved_form_data_entries.html')[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.view_saved_form_wizard_data_entries(request, form_wizard_entry_id=None, theme=None, template_name='db_store/view_saved_form_wizard_data_entries.html')[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
- 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'¶
- 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.
- name = 'HTTP Repost'¶
- 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.- name = 'HTTP Repost'¶
- run(form_wizard_entry, request, form_list, form_wizard, form_element_entries=None)[source]¶
Run.
- Parameters
form_wizard_entry (fobi.models.FormWizardEntry) – Instance of
fobi.models.FormWizardEntry
.request (django.http.HttpRequest) –
form_list (list) – List of
django.forms.Form
instances.form_wizard (fobi.wizard.views.dynamic.DynamicWizardView) – Instance of
fobi.wizard.views.dynamic.DynamicWizardView
.form_element_entries (iterable) – Iterable of
fobi.models.FormElementEntry
objects.
- uid = 'http_repost'¶
- 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.
- name = 'HTTP Repost'¶
- 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.- name = 'HTTP Repost'¶
- run(form_wizard_entry, request, form_list, form_wizard, form_element_entries=None)[source]¶
Run.
- Parameters
form_wizard_entry (fobi.models.FormWizardEntry) – Instance of
fobi.models.FormWizardEntry
.request (django.http.HttpRequest) –
form_list (list) – List of
django.forms.Form
instances.form_wizard (fobi.wizard.views.dynamic.DynamicWizardView) – Instance of
fobi.wizard.views.dynamic.DynamicWizardView
.form_element_entries (iterable) – Iterable of
fobi.models.FormElementEntry
objects.
- uid = 'http_repost'¶
- class fobi.contrib.plugins.form_handlers.http_repost.forms.HTTPRepostForm(data=None, files=None, auto_id='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, renderer=None)[source]¶
Bases:
django.forms.forms.Form
,fobi.base.BasePluginForm
Form for
HTTPRepostPlugin
.- base_fields = {'endpoint_url': <django.forms.fields.URLField object>}¶
- declared_fields = {'endpoint_url': <django.forms.fields.URLField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- plugin_data_fields = [('endpoint_url', '')]¶
- class fobi.contrib.plugins.form_handlers.mail.base.MailHandlerPlugin(user=None)[source]¶
Bases:
fobi.base.FormHandlerPlugin
,fobi.contrib.plugins.form_handlers.mail.mixins.MailHandlerMixin
Mail handler plugin.
Sends emails to the person specified. Should be executed before
db_store
andhttp_repost
plugins.- form¶
alias of
fobi.contrib.plugins.form_handlers.mail.forms.MailForm
- name = 'Mail'¶
- 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 = '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
andhttp_repost
plugins.- form¶
alias of
fobi.contrib.plugins.form_handlers.mail.forms.MailForm
- name = 'Mail'¶
- run(form_wizard_entry, request, form_list, form_wizard, form_element_entries=None)[source]¶
Run.
- Parameters
form_wizard_entry (fobi.models.FormWizardEntry) – Instance of
fobi.models.FormWizardEntry
.request (django.http.HttpRequest) –
form_list (list) – List of
django.forms.Form
instances.form_wizard (fobi.wizard.views.dynamic.DynamicWizardView) – Instance of
fobi.wizard.views.dynamic.DynamicWizardView
.form_element_entries (iterable) – Iterable of
fobi.models.FormElementEntry
objects.
- uid = 'mail'¶
- class fobi.contrib.plugins.form_handlers.mail.callbacks.AutoFormMail[source]¶
Bases:
fobi.base.FormCallback
,fobi.contrib.plugins.form_handlers.mail.mixins.MailHandlerMixin
Auto mail form entries.
Note, that this callback is not active. In order to activate it, you should import the
AutoFormMail
and register it using the callback register as follows.>>> from fobi.base import form_callback_registry >>> from fobi.contrib.plugins.form_handlers.mail.callbacks import ( >>> AutoFormMail >>> ) >>> form_callback_registry.register(AutoFormMail)
- callback(form_entry, request, form)[source]¶
Callback.
- Parameters
form_entry –
request –
form –
- Returns
- stage = 'form_valid'¶
- 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.
- class fobi.contrib.plugins.form_handlers.mail.fields.MultiEmailField(*, required=True, widget=None, label=None, initial=None, help_text='', 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 = 'Enter valid email addresses.'¶
- class fobi.contrib.plugins.form_handlers.mail.fobi_form_handlers.MailHandlerPlugin(user=None)[source]¶
Bases:
fobi.base.FormHandlerPlugin
,fobi.contrib.plugins.form_handlers.mail.mixins.MailHandlerMixin
Mail handler plugin.
Sends emails to the person specified. Should be executed before
db_store
andhttp_repost
plugins.- form¶
alias of
fobi.contrib.plugins.form_handlers.mail.forms.MailForm
- name = 'Mail'¶
- 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 = '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
andhttp_repost
plugins.- form¶
alias of
fobi.contrib.plugins.form_handlers.mail.forms.MailForm
- name = 'Mail'¶
- run(form_wizard_entry, request, form_list, form_wizard, form_element_entries=None)[source]¶
Run.
- Parameters
form_wizard_entry (fobi.models.FormWizardEntry) – Instance of
fobi.models.FormWizardEntry
.request (django.http.HttpRequest) –
form_list (list) – List of
django.forms.Form
instances.form_wizard (fobi.wizard.views.dynamic.DynamicWizardView) – Instance of
fobi.wizard.views.dynamic.DynamicWizardView
.form_element_entries (iterable) – Iterable of
fobi.models.FormElementEntry
objects.
- uid = 'mail'¶
- class fobi.contrib.plugins.form_handlers.mail.forms.MailForm(data=None, files=None, auto_id='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, renderer=None)[source]¶
Bases:
django.forms.forms.Form
,fobi.base.BasePluginForm
Form for
BooleanSelectPlugin
.- base_fields = {'body': <django.forms.fields.CharField object>, 'from_email': <django.forms.fields.EmailField object>, 'from_name': <django.forms.fields.CharField object>, 'subject': <django.forms.fields.CharField object>, 'to_email': <fobi.contrib.plugins.form_handlers.mail.fields.MultiEmailField object>, 'to_name': <django.forms.fields.CharField object>}¶
- declared_fields = {'body': <django.forms.fields.CharField object>, 'from_email': <django.forms.fields.EmailField object>, 'from_name': <django.forms.fields.CharField object>, 'subject': <django.forms.fields.CharField object>, 'to_email': <fobi.contrib.plugins.form_handlers.mail.fields.MultiEmailField object>, 'to_name': <django.forms.fields.CharField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- plugin_data_fields = [('from_name', ''), ('from_email', ''), ('to_name', ''), ('to_email', ''), ('subject', ''), ('body', '')]¶
- 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.
- 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 = {'choices': 'choices', 'help_text': 'helptext', 'initial': 'default', 'label': 'name', 'name': 'tag', 'required': 'req'}¶
- field_type_prop_name = 'field_type'¶
- fields_mapping = {'address': 'text', 'date': 'date', 'dropdown': 'select', 'email': 'email', 'imageurl': 'url', 'number': 'integer', 'phone': 'text', 'radio': 'radio', 'text': 'text', 'url': 'url', 'zip': 'text'}¶
- name = 'MailChimp'¶
- position_prop_name = 'order'¶
- templates = ['mailchimp_importer/0.html', 'mailchimp_importer/1.html']¶
- uid = 'mailchimp'¶
- 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 = {'choices': 'choices', 'help_text': 'helptext', 'initial': 'default', 'label': 'name', 'name': 'tag', 'required': 'req'}¶
- field_type_prop_name = 'field_type'¶
- fields_mapping = {'address': 'text', 'date': 'date', 'dropdown': 'select', 'email': 'email', 'imageurl': 'url', 'number': 'integer', 'phone': 'text', 'radio': 'radio', 'text': 'text', 'url': 'url', 'zip': 'text'}¶
- name = 'MailChimp'¶
- position_prop_name = 'order'¶
- templates = ['mailchimp_importer/0.html', 'mailchimp_importer/1.html']¶
- uid = 'mailchimp'¶
- class fobi.contrib.plugins.form_importers.mailchimp_importer.forms.MailchimpAPIKeyForm(data=None, files=None, auto_id='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, renderer=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 = {'api_key': <django.forms.fields.CharField object>}¶
- declared_fields = {'api_key': <django.forms.fields.CharField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- 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 = {'list_id': <django.forms.fields.ChoiceField object>}¶
- declared_fields = {'list_id': <django.forms.fields.ChoiceField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- class fobi.contrib.plugins.form_importers.mailchimp_importer.views.MailchimpImporterWizardView(**kwargs)[source]¶
Bases:
fobi.wizard.views.views.SessionWizardView
MailchimpImporterWizardView.
- done(form_list, **kwargs)[source]¶
This method must be overridden by a subclass to process to form data after processing all steps.
- form_list = [<class 'fobi.contrib.plugins.form_importers.mailchimp_importer.forms.MailchimpAPIKeyForm'>, <class 'fobi.contrib.plugins.form_importers.mailchimp_importer.forms.MailchimpListIDForm'>]¶
- class fobi.contrib.themes.bootstrap3.widgets.form_elements.content_markdown_bootstrap3_widget.apps.Config(app_name, app_module)[source]¶
Bases:
django.apps.config.AppConfig
Config.
- label = 'fobi_contrib_themes_bootstrap3_widgets_form_elements_content_markdown_bootstrap3_widget'¶
- name = 'fobi.contrib.themes.bootstrap3.widgets.form_elements.content_markdown_bootstrap3_widget'¶
- class fobi.contrib.themes.bootstrap3.widgets.form_elements.content_markdown_bootstrap3_widget.fobi_form_elements.ContentMarkdownPluginWidget(plugin)[source]¶
Bases:
fobi.contrib.plugins.form_elements.content.content_markdown.widgets.BaseContentMarkdownPluginWidget
ContentMarkdownText plugin widget for Bootstrap 3.
- theme_uid = 'bootstrap3'¶
- class fobi.contrib.themes.bootstrap3.widgets.form_elements.content_richtext_bootstrap3_widget.apps.Config(app_name, app_module)[source]¶
Bases:
django.apps.config.AppConfig
Config.
- label = 'fobi_contrib_themes_bootstrap3_widgets_form_elements_content_richtext_bootstrap3_widget'¶
- name = 'fobi.contrib.themes.bootstrap3.widgets.form_elements.content_richtext_bootstrap3_widget'¶
- class fobi.contrib.themes.bootstrap3.widgets.form_elements.content_richtext_bootstrap3_widget.fobi_form_elements.ContentRichTextPluginWidget(plugin)[source]¶
Bases:
fobi.contrib.plugins.form_elements.content.content_richtext.widgets.BaseContentRichTextPluginWidget
ContentRichText plugin widget for Bootstrap 3.
- theme_uid = 'bootstrap3'¶
- 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'¶
- 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'¶
- 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'¶
- 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'¶
- 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'¶
- 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'¶
- 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'¶
- 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'¶
- 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_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 = 'Bootstrap 3'¶
- 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'¶
- class fobi.contrib.themes.djangocms_admin_style_theme.widgets.form_elements.content_richtext_admin_style_widget.apps.Config(app_name, app_module)[source]¶
Bases:
django.apps.config.AppConfig
Config.
- label = 'fobi_contrib_themes_djangocms_admin_style_theme_widgets_form_elements_content_richtext_admin_style_widget'¶
- name = 'fobi.contrib.themes.djangocms_admin_style_theme.widgets.form_elements.content_richtext_admin_style_widget'¶
- class fobi.contrib.themes.djangocms_admin_style_theme.widgets.form_elements.content_richtext_admin_style_widget.fobi_form_elements.ContentRichTextPluginWidget(plugin)[source]¶
Bases:
fobi.contrib.plugins.form_elements.content.content_richtext.widgets.BaseContentRichTextPluginWidget
ContentRichText plugin widget for djangocms_admin_style theme.
- theme_uid = 'simple'¶
- 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'¶
- 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 = ''¶
- 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 = 'DjangoCMS admin style'¶
- 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'¶
- class fobi.contrib.themes.foundation5.widgets.form_elements.content_richtext_foundation5_widget.apps.Config(app_name, app_module)[source]¶
Bases:
django.apps.config.AppConfig
Config.
- label = 'fobi_contrib_themes_foundation5_widgets_form_elements_content_richtext_foundation5_widget'¶
- name = 'fobi.contrib.themes.foundation5.widgets.form_elements.content_richtext_foundation5_widget'¶
- class fobi.contrib.themes.foundation5.widgets.form_elements.content_richtext_foundation5_widget.fobi_form_elements.ContentRichTextPluginWidget(plugin)[source]¶
Bases:
fobi.contrib.plugins.form_elements.content.content_richtext.widgets.BaseContentRichTextPluginWidget
Content rich-text plugin widget for Foundation 5.
- theme_uid = 'foundation5'¶
- 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'¶
- 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'¶
- 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'¶
- 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'¶
- 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'¶
- 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'¶
- 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'¶
- 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'¶
- 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'¶
- create_form_wizard_entry_ajax_template = 'foundation5/create_form_wizard_entry_ajax.html'¶
- create_form_wizard_entry_template = 'foundation5/create_form_wizard_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'¶
- edit_form_wizard_entry_ajax_template = 'foundation5/edit_form_wizard_entry_ajax.html'¶
- edit_form_wizard_entry_template = 'foundation5/edit_form_wizard_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_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'¶
- form_wizard_ajax = 'foundation5/snippets/form_wizard_ajax.html'¶
- form_wizard_properties_snippet_template_name = 'foundation5/snippets/form_wizard_properties_snippet.html'¶
- form_wizard_snippet_template_name = 'foundation5/snippets/form_wizard_snippet.html'¶
- form_wizards_dashboard_template = 'foundation5/form_wizards_dashboard.html'¶
- 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 = 'Foundation 5'¶
- uid = 'foundation5'¶
- view_form_entry_ajax_template = 'foundation5/view_form_entry_ajax.html'¶
- view_form_entry_template = 'foundation5/view_form_entry.html'¶
- view_form_wizard_entry_ajax_template = 'foundation5/view_form_wizard_entry_ajax.html'¶
- view_form_wizard_entry_template = 'foundation5/view_form_wizard_entry.html'¶
- class fobi.contrib.themes.simple.widgets.form_elements.content_richtext_simple_widget.apps.Config(app_name, app_module)[source]¶
Bases:
django.apps.config.AppConfig
Config.
- label = 'fobi_contrib_themes_simple_widgets_form_elements_content_richtext_simple_widget'¶
- name = 'fobi.contrib.themes.simple.widgets.form_elements.content_richtext_simple_widget'¶
- class fobi.contrib.themes.simple.widgets.form_elements.content_richtext_simple_widget.fobi_form_elements.ContentRichTextPluginWidget(plugin)[source]¶
Bases:
fobi.contrib.plugins.form_elements.content.content_richtext.widgets.BaseContentRichTextPluginWidget
ContentRichText plugin widget for Simple theme.
- theme_uid = 'simple'¶
- 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 = ''¶
- 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'¶
- create_form_wizard_entry_ajax_template = 'simple/create_form_wizard_entry_ajax.html'¶
- create_form_wizard_entry_template = 'simple/create_form_wizard_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'¶
- edit_form_wizard_entry_ajax_template = 'simple/edit_form_wizard_entry_ajax.html'¶
- edit_form_wizard_entry_template = 'simple/edit_form_wizard_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'¶
- form_wizard_properties_snippet_template_name = 'simple/snippets/form_wizard_properties_snippet.html'¶
- form_wizard_snippet_template_name = 'simple/snippets/form_wizard_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 admin style'¶
- uid = 'simple'¶
- view_form_entry_ajax_template = 'simple/view_form_entry_ajax.html'¶
- view_form_entry_template = 'simple/view_form_entry.html'¶
- view_form_wizard_entry_ajax_template = 'simple/view_form_wizard_entry_ajax.html'¶
- view_form_wizard_entry_template = 'simple/view_form_wizard_entry.html'¶
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_process_form_redirect_url(request, instance)[source]¶
Get process form redirect URL (success).
- Parameters
request (django.http.HttpRequest) –
instance (fobi.models.FormEntry) –
- Return str
- 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¶
- class fobi.management.commands.fobi_sync_plugins.Command(stdout=None, stderr=None, no_color=False, force_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
- class fobi.management.commands.fobi_update_plugin_data.Command(stdout=None, stderr=None, no_color=False, force_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.
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 = [('auth', '__first__'), ('auth', '0006_require_contenttypes_0002')]¶
- operations = [<CreateModel name='FormElement', fields=[('id', <django.db.models.fields.AutoField>), ('plugin_uid', <django.db.models.fields.CharField>), ('groups', <django.db.models.fields.related.ManyToManyField>), ('users', <django.db.models.fields.related.ManyToManyField>)], options={'abstract': False, 'verbose_name': 'Form element plugin', 'verbose_name_plural': 'Form element plugins'}>, <CreateModel name='FormElementEntry', fields=[('id', <django.db.models.fields.AutoField>), ('plugin_data', <django.db.models.fields.TextField>), ('plugin_uid', <django.db.models.fields.CharField>), ('position', <django.db.models.fields.PositiveIntegerField>)], options={'ordering': ['position'], 'abstract': False, 'verbose_name': 'Form element entry', 'verbose_name_plural': 'Form element entries'}>, <CreateModel name='FormEntry', fields=[('id', <django.db.models.fields.AutoField>), ('name', <django.db.models.fields.CharField>), ('slug', <autoslug.fields.AutoSlugField>), ('is_public', <django.db.models.fields.BooleanField>), ('is_cloneable', <django.db.models.fields.BooleanField>), ('position', <django.db.models.fields.PositiveIntegerField>), ('success_page_title', <django.db.models.fields.CharField>), ('success_page_message', <django.db.models.fields.TextField>), ('action', <django.db.models.fields.CharField>)], options={'verbose_name': 'Form entry', 'verbose_name_plural': 'Form entries'}>, <CreateModel name='FormFieldsetEntry', fields=[('id', <django.db.models.fields.AutoField>), ('name', <django.db.models.fields.CharField>), ('is_repeatable', <django.db.models.fields.BooleanField>), ('form_entry', <django.db.models.fields.related.ForeignKey>)], options={'verbose_name': 'Form fieldset entry', 'verbose_name_plural': 'Form fieldset entries'}>, <CreateModel name='FormHandler', fields=[('id', <django.db.models.fields.AutoField>), ('plugin_uid', <django.db.models.fields.CharField>), ('groups', <django.db.models.fields.related.ManyToManyField>), ('users', <django.db.models.fields.related.ManyToManyField>)], options={'abstract': False, 'verbose_name': 'Form handler plugin', 'verbose_name_plural': 'Form handler plugins'}>, <CreateModel name='FormHandlerEntry', fields=[('id', <django.db.models.fields.AutoField>), ('plugin_data', <django.db.models.fields.TextField>), ('plugin_uid', <django.db.models.fields.CharField>), ('form_entry', <django.db.models.fields.related.ForeignKey>)], options={'abstract': False, 'verbose_name': 'Form handler entry', 'verbose_name_plural': 'Form handler entries'}>, <CreateModel name='FormWizardEntry', fields=[('id', <django.db.models.fields.AutoField>), ('name', <django.db.models.fields.CharField>), ('slug', <autoslug.fields.AutoSlugField>), ('is_public', <django.db.models.fields.BooleanField>), ('is_cloneable', <django.db.models.fields.BooleanField>), ('user', <django.db.models.fields.related.ForeignKey>)], options={'verbose_name': 'Form wizard entry', 'verbose_name_plural': 'Form wizard entries'}>, <AddField model_name='formentry', name='form_wizard_entry', field=<django.db.models.fields.related.ForeignKey>>, <AddField model_name='formentry', name='user', field=<django.db.models.fields.related.ForeignKey>>, <AddField model_name='formelemententry', name='form_entry', field=<django.db.models.fields.related.ForeignKey>>, <AddField model_name='formelemententry', name='form_fieldset_entry', field=<django.db.models.fields.related.ForeignKey>>, <AlterUniqueTogether name='formwizardentry', unique_together={('user', 'slug'), ('user', 'name')}>, <AlterUniqueTogether name='formfieldsetentry', unique_together={('form_entry', 'name')}>, <AlterUniqueTogether name='formentry', unique_together={('user', 'slug'), ('user', 'name')}>]¶
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 = [('fobi', '0001_initial')]¶
- operations = [<AddField model_name='formentry', name='created', field=<django.db.models.fields.DateTimeField>>, <AddField model_name='formentry', name='updated', field=<django.db.models.fields.DateTimeField>>]¶
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 = [('fobi', '0002_auto_20150912_1744')]¶
- operations = [<AlterField model_name='formelement', name='plugin_uid', field=<django.db.models.fields.CharField>>, <AlterField model_name='formelemententry', name='plugin_uid', field=<django.db.models.fields.CharField>>, <AlterField model_name='formentry', name='slug', field=<autoslug.fields.AutoSlugField>>, <AlterField model_name='formhandler', name='plugin_uid', field=<django.db.models.fields.CharField>>, <AlterField model_name='formhandlerentry', name='plugin_uid', field=<django.db.models.fields.CharField>>, <AlterField model_name='formwizardentry', name='slug', field=<autoslug.fields.AutoSlugField>>]¶
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 = [('fobi', '0003_auto_20160517_1005')]¶
- operations = [<AlterField model_name='formelement', name='plugin_uid', field=<django.db.models.fields.CharField>>, <AlterField model_name='formelemententry', name='plugin_uid', field=<django.db.models.fields.CharField>>, <AlterField model_name='formhandler', name='plugin_uid', field=<django.db.models.fields.CharField>>, <AlterField model_name='formhandlerentry', name='plugin_uid', field=<django.db.models.fields.CharField>>]¶
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 = [('fobi', '0004_auto_20160906_1513')]¶
- operations = [<AlterField model_name='formelement', name='plugin_uid', field=<django.db.models.fields.CharField>>, <AlterField model_name='formelemententry', name='plugin_uid', field=<django.db.models.fields.CharField>>]¶
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 = [('fobi', '0005_auto_20160908_1457')]¶
- operations = [<AlterField model_name='formhandler', name='plugin_uid', field=<django.db.models.fields.CharField>>, <AlterField model_name='formhandlerentry', name='plugin_uid', field=<django.db.models.fields.CharField>>]¶
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 = [('fobi', '0006_auto_20160911_1549')]¶
- operations = [<CreateModel name='FormWizardFormEntry', fields=[('id', <django.db.models.fields.AutoField>), ('position', <django.db.models.fields.PositiveIntegerField>)], options={'ordering': ['position'], 'abstract': False, 'verbose_name': 'Form wizard form entry', 'verbose_name_plural': 'Form wizard form entries'}>, <RemoveField model_name='formentry', name='form_wizard_entry'>, <RemoveField model_name='formentry', name='position'>, <AddField model_name='formwizardentry', name='created', field=<django.db.models.fields.DateTimeField>>, <AddField model_name='formwizardentry', name='success_page_message', field=<django.db.models.fields.TextField>>, <AddField model_name='formwizardentry', name='success_page_title', field=<django.db.models.fields.CharField>>, <AddField model_name='formwizardentry', name='updated', field=<django.db.models.fields.DateTimeField>>, <AddField model_name='formwizardformentry', name='form_entry', field=<django.db.models.fields.related.ForeignKey>>, <AddField model_name='formwizardformentry', name='form_wizard_entry', field=<django.db.models.fields.related.ForeignKey>>, <AlterUniqueTogether name='formwizardformentry', unique_together={('form_wizard_entry', 'form_entry')}>]¶
fobi.migrations.0008_formwizardhandlerentry module¶
- class fobi.migrations.0008_formwizardhandlerentry.Migration(name, app_label)[source]¶
Bases:
django.db.migrations.migration.Migration
- dependencies = [('fobi', '0007_auto_20160926_1652')]¶
- operations = [<CreateModel name='FormWizardHandlerEntry', fields=[('id', <django.db.models.fields.AutoField>), ('plugin_data', <django.db.models.fields.TextField>), ('plugin_uid', <django.db.models.fields.CharField>), ('form_wizard_entry', <django.db.models.fields.related.ForeignKey>)], options={'abstract': False, 'verbose_name': 'Form wizard handler entry', 'verbose_name_plural': 'Form wizard handler entries'}>]¶
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 = [('fobi', '0008_formwizardhandlerentry')]¶
- operations = [<AddField model_name='formwizardentry', name='wizard_type', field=<django.db.models.fields.CharField>>]¶
fobi.migrations.0010_formwizardhandler module¶
- class fobi.migrations.0010_formwizardhandler.Migration(name, app_label)[source]¶
Bases:
django.db.migrations.migration.Migration
- dependencies = [('auth', '0007_alter_validators_add_error_messages'), ('auth', '__first__'), ('fobi', '0009_formwizardentry_wizard_type')]¶
- operations = [<CreateModel name='FormWizardHandler', fields=[('id', <django.db.models.fields.AutoField>), ('plugin_uid', <django.db.models.fields.CharField>), ('groups', <django.db.models.fields.related.ManyToManyField>), ('users', <django.db.models.fields.related.ManyToManyField>)], options={'abstract': False, 'verbose_name': 'Form wizard handler plugin', 'verbose_name_plural': 'Form wizard handler plugins'}>]¶
fobi.migrations.0011_formentry_title module¶
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 = [('fobi', '0011_formentry_title')]¶
- operations = [<AddField model_name='formwizardentry', name='title', field=<django.db.models.fields.CharField>>, <AlterField model_name='formentry', name='title', field=<django.db.models.fields.CharField>>]¶
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 = [('fobi', '0013_formwizardentry_show_all_navigation_buttons')]¶
- operations = [<AlterField model_name='formentry', name='slug', field=<autoslug.fields.AutoSlugField>>, <AlterField model_name='formentry', name='title', field=<django.db.models.fields.CharField>>, <AlterField model_name='formwizardentry', name='slug', field=<autoslug.fields.AutoSlugField>>, <AlterField model_name='formwizardentry', name='title', field=<django.db.models.fields.CharField>>, <AlterField model_name='formwizardentry', name='wizard_type', field=<django.db.models.fields.CharField>>]¶
Module contents¶
fobi.reusable package¶
Subpackages¶
- class fobi.reusable.markdown_widget.widgets.MarkdownWidget(attrs=None)[source]¶
Bases:
django.forms.widgets.Textarea
Markdown widget based on remarkable.
- class Media[source]¶
Bases:
object
Media options.
- js = ['markdown_widget/remarkable.min.js', 'content_markdown/fobi.plugin.content_markdown.js']¶
- property media¶
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 offobi.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 offobi.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 offobi.models.FormElementEntry
orfobi.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 %}
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 %}
- 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)[source]¶
Output the first variable passed that is not False.
Output nothing if all the passed variables are False.
Sample usage:
{% firstof var1 var2 var3 as myvar %}
This is equivalent to:
{% if var1 %} {{ var1 }} {% elif var2 %} {{ var2 }} {% elif var3 %} {{ var3 }} {% 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 disable auto-escaping of variables you can use:
{% autoescape off %} {% firstof var1 var2 var3 "<strong>fallback value</strong>" %} {% autoescape %}
Or if only some variables should be escaped, you can use:
{% firstof var1 var2|safe var3 "<strong>fallback value</strong>"|safe %}
Module contents¶
fobi.tests package¶
Submodules¶
fobi.tests.base module¶
- class fobi.tests.base.BaseFobiBrowserBuldDynamicFormsTest(methodName='runTest')[source]¶
Bases:
django.contrib.staticfiles.testing.StaticLiveServerTestCase
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¶
- reset_sequences = True¶
fobi.tests.constants module¶
fobi.tests.core 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(clean_form=False, clean_elements=True, clean_handlers=True)[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.test_browser_build_dynamic_forms module¶
- class fobi.tests.test_browser_build_dynamic_forms.FobiBrowserBuldDynamicFormsTest(methodName='runTest')[source]¶
Bases:
fobi.tests.base.BaseFobiBrowserBuldDynamicFormsTest
Browser tests django-fobi bulding forms functionality.
Backed up by selenium. This test is based on the bootstrap3 theme.
- test_1001_open_dashboard(*args, **kwargs)¶
Inner.
- test_1001_open_dashboard_fbv(*args, **kwargs)¶
Inner.
- test_2001_add_form(*args, **kwargs)¶
Inner.
- test_2001_add_form_fbv(*args, **kwargs)¶
Inner.
- test_2002_edit_form(*args, **kwargs)¶
Inner.
- test_2002_edit_form_fbv(*args, **kwargs)¶
Inner.
- test_2003_delete_form(*args, **kwargs)¶
Inner.
- test_2003_delete_form_fbv(*args, **kwargs)¶
Inner.
- test_2004_submit_form(*args, **kwargs)¶
Inner.
- test_2004_submit_form_fbv(*args, **kwargs)¶
Inner.
- test_3001_add_form_elements(*args, **kwargs)¶
Inner.
- test_3001_add_form_elements_fbv(*args, **kwargs)¶
Inner.
- test_3002_remove_form_elements(*args, **kwargs)¶
Inner.
- test_3002_remove_form_elements_fbv(*args, **kwargs)¶
Inner.
- test_3003_edit_form_elements(*args, **kwargs)¶
Inner.
- test_3003_edit_form_elements_fbv(*args, **kwargs)¶
Inner.
- test_4001_add_form_handlers(*args, **kwargs)¶
Inner.
- test_4001_add_form_handlers_fbv(*args, **kwargs)¶
Inner.
- test_4002_remove_form_handlers(*args, **kwargs)¶
Inner.
- test_4002_remove_form_handlers_fbv(*args, **kwargs)¶
Inner.
- test_4003_edit_form_handlers(*args, **kwargs)¶
Inner.
- test_4003_edit_form_handlers_fbv(*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.
- 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.
- test_06_form_entry_get_absolute_url(*args, **kwargs)¶
Inner.
- test_07_form_wizard_entry_get_absolute_url(*args, **kwargs)¶
Inner.
- test_08_form_entry_is_active(*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.
- test_04_fail_options_action_non_public_form()[source]¶
Test OPTIONS 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.
fobi.tests.test_dynamic_forms module¶
fobi.tests.test_feincms_integration module¶
- class fobi.tests.test_feincms_integration.FeinCMSIntegrationTest(methodName='runTest')[source]¶
Bases:
fobi.tests.base.BaseFobiBrowserBuldDynamicFormsTest
FeinCMS integration tests.
fobi.tests.test_form_importers_mailchimp module¶
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.- test_01_sortable_dict_move_before_key(*args, **kwargs)¶
Inner.
- test_02_sortable_dict_move_after_key(*args, **kwargs)¶
Inner.
Module contents¶
fobi.wizard package¶
Subpackages¶
- 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.DynamicNamedUrlCookieWizardView(**kwargs)[source]¶
Bases:
fobi.wizard.views.dynamic.DynamicNamedUrlWizardView
A NamedUrlFormWizard with pre-configured CookieStorageBackend.
- storage_name = 'formtools.wizard.storage.cookie.CookieStorage'¶
- 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.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.
- 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.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.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.
- 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 aModelFormSet
. 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_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.views.CookieWizardView(**kwargs)[source]¶
Bases:
formtools.wizard.views.CookieWizardView
,fobi.wizard.views.views.PatchGetMixin
A WizardView with pre-configured CookieStorage backend.
- 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.
Module contents¶
Submodules¶
fobi.admin module¶
- class fobi.admin.BasePluginModelAdmin(model, admin_site)[source]¶
Bases:
django.contrib.admin.options.ModelAdmin
Base plugin admin.
- bulk_change_plugins(request)[source]¶
Bulk change plugins.
This is where the data is actually processed.
- fieldsets = ((None, {'fields': ('plugin_uid', 'users', 'groups')}),)¶
- filter_horizontal = ('users', 'groups')¶
- 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.
- list_display = ('plugin_uid_admin', 'users_list', 'groups_list')¶
- property media¶
- readonly_fields = ('plugin_uid', 'plugin_uid_admin')¶
- class fobi.admin.FormElementAdmin(model, admin_site)[source]¶
Bases:
fobi.admin.BasePluginModelAdmin
FormElement admin.
- actions = (<function bulk_change_form_element_plugins>,)¶
- property media¶
- class fobi.admin.FormElementEntryAdmin(model, admin_site)[source]¶
Bases:
django.contrib.admin.options.ModelAdmin
FormElementEntry admin.
- fieldsets = (('Plugin', {'fields': ('plugin_uid', 'plugin_data')}), ('Form', {'fields': ('form_entry', 'form_fieldset_entry', 'position')}))¶
- list_display = ('plugin_uid', 'plugin_uid_code', 'plugin_data', 'position', 'form_entry')¶
- list_editable = ('position',)¶
- list_filter = ('form_entry', 'plugin_uid')¶
- property media¶
- 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
fobi.forms.FormElementEntryForm
- property media¶
- model¶
alias of
fobi.models.FormElementEntry
- class fobi.admin.FormEntryAdmin(model, admin_site)[source]¶
Bases:
django.contrib.admin.options.ModelAdmin
FormEntry admin.
- fieldsets = (('Form', {'fields': ('name', 'is_public', 'is_cloneable', 'active_date_from', 'active_date_to', 'inactive_page_title', 'inactive_page_message')}), ('Custom', {'classes': ('collapse',), 'fields': ('success_page_title', 'success_page_message', 'action')}), ('User', {'classes': ('collapse',), 'fields': ('user',)}), ('Additional', {'classes': ('collapse',), 'fields': ('slug',)}))¶
- inlines = [<class 'fobi.admin.FormElementEntryInlineAdmin'>, <class 'fobi.admin.FormHandlerEntryInlineAdmin'>]¶
- list_display = ('name', 'slug', 'user', 'is_public', 'is_active', 'created', 'updated', 'is_cloneable')¶
- list_editable = ('is_public', 'is_cloneable')¶
- list_filter = ('is_public', 'is_cloneable')¶
- property media¶
- radio_fields = {'user': 2}¶
- readonly_fields = ('slug',)¶
- class fobi.admin.FormFieldsetEntryAdmin(model, admin_site)[source]¶
Bases:
django.contrib.admin.options.ModelAdmin
FormEieldsetEntry admin.
- fieldsets = ((None, {'fields': ('form_entry', 'name', 'is_repeatable')}),)¶
- list_display = ('form_entry', 'name', 'is_repeatable')¶
- list_editable = ('is_repeatable',)¶
- list_filter = ('is_repeatable',)¶
- property media¶
- class fobi.admin.FormHandlerAdmin(model, admin_site)[source]¶
Bases:
fobi.admin.BasePluginModelAdmin
FormHandler admin.
- actions = (<function bulk_change_form_handler_plugins>,)¶
- property media¶
- class fobi.admin.FormHandlerEntryAdmin(model, admin_site)[source]¶
Bases:
django.contrib.admin.options.ModelAdmin
FormHandlerEntry admin.
- fieldsets = (('Plugin', {'fields': ('plugin_uid', 'plugin_data')}), ('Form', {'fields': ('form_entry',)}))¶
- list_display = ('plugin_uid', 'plugin_uid_code', 'plugin_data', 'form_entry')¶
- list_filter = ('form_entry', 'plugin_uid')¶
- property media¶
- 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
fobi.forms.FormHandlerEntryForm
- property media¶
- model¶
alias of
fobi.models.FormHandlerEntry
- class fobi.admin.FormWizardEntryAdmin(model, admin_site)[source]¶
Bases:
django.contrib.admin.options.ModelAdmin
FormWizardEntry admin.
- fieldsets = (('Form', {'fields': ('name', 'is_public', 'is_cloneable')}), ('Custom', {'classes': ('collapse',), 'fields': ('success_page_title', 'success_page_message')}), ('User', {'classes': ('collapse',), 'fields': ('user',)}), ('Additional', {'classes': ('collapse',), 'fields': ('slug',)}))¶
- inlines = [<class 'fobi.admin.FormWizardFormEntryInlineAdmin'>, <class 'fobi.admin.FormWizardHandlerEntryInlineAdmin'>]¶
- list_display = ('name', 'slug', 'user', 'is_public', 'created', 'updated', 'is_cloneable')¶
- list_editable = ('is_public', 'is_cloneable')¶
- list_filter = ('is_public', 'is_cloneable')¶
- property media¶
- radio_fields = {'user': 2}¶
- 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')¶
- property media¶
- model¶
alias of
fobi.models.FormWizardFormEntry
- class fobi.admin.FormWizardHandlerAdmin(model, admin_site)[source]¶
Bases:
fobi.admin.BasePluginModelAdmin
FormHandler admin.
- actions = (<function bulk_change_form_wizard_handler_plugins>,)¶
- property 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¶
- property media¶
- model¶
alias of
fobi.models.FormWizardHandlerEntry
- fobi.admin.base_bulk_change_plugins(PluginForm, named_url, modeladmin, request, queryset)[source]¶
Bulk change of plugins action additional view.
- fobi.admin.bulk_change_form_element_plugins(modeladmin, request, queryset)[source]¶
Bulk change FormElement plugins.
fobi.app module¶
fobi.apps module¶
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).
- 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>¶
- 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
andfobi.views.edit_form_plugin_entry
views.
- form: Plugin form (optional). A subclass of
django.forms.Form
. Should be given in case plugin is configurable.
- form: Plugin form (optional). A subclass of
- 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
andfobi.views.delete_form_handler_entry
. Fired automatically, whenfobi.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 theform
attribute defined in your plugin.- Return django.forms.Form|django.forms.ModelForm
Subclass of
django.forms.Form
ordjango.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
andfobi.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 raisesdjango.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
andfobi.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 raisesdjango.http.Http404
on errors.
- 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 = 'General'¶
- help_text = None¶
- property 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 = []¶
- property html_id¶
HTML id.
- load_plugin_data(plugin_data)[source]¶
Load plugin data.
Load the plugin data saved in
fobi.models.FormElementEntry
orfobi.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).
- 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 offobi.models.FormElementEntry
orfobi.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 runfobi_update_plugin_data
management command (seefobi.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 thesave_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 thefobi.models.FormElementEntry
or ``fobi.models.FormHandlerEntry`.` subclassed model.- Parameters
request (django.http.HttpRequest) –
- plugin_data_fields = None¶
- 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.
- plugin_not_found_error_message = "Can't find plugin with uid `{0}` in `{1}` registry."¶
- plugin_not_found_exception_cls¶
alias of
fobi.exceptions.DoesNotExist
- register(cls, force=False)[source]¶
Registers the plugin in the registry.
- Parameters
cls (mixed) –
force (bool) –
- property registry¶
Shortcut to self._registry.
- type = None¶
- class fobi.base.ClassProperty(fget=None, fset=None, fdel=None, doc=None)[source]¶
Bases:
property
ClassProperty.
- 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
.
- 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
request (django.http.HttpRequest) –
form_entry (fobi.models.FormEntry) –
form_element_entries (django.db.models.QuerySet) – Queryset of
fobi.models.FormElementEntry
instances.
- 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¶
- storage¶
- 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¶
- 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
fobi.base.FormElementPluginWidgetDataStorage
- class fobi.base.FormElementPluginWidgetRegistry[source]¶
Bases:
fobi.base.BasePluginWidgetRegistry
Registry of form element plugins.
- type¶
alias of
fobi.base.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¶
- 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¶
- type¶
alias of
fobi.base.FormHandlerPlugin
- class fobi.base.FormHandlerPluginWidget(plugin)[source]¶
Bases:
fobi.base.BasePluginWidget
Form handler plugin widget.
- storage¶
alias of
fobi.base.FormHandlerPluginWidgetDataStorage
- class fobi.base.FormHandlerPluginWidgetRegistry[source]¶
Bases:
fobi.base.BasePluginWidgetRegistry
Registry of form handler plugins.
- type¶
alias of
fobi.base.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¶
- 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
fobi.exceptions.FormWizardHandlerPluginDoesNotExist
- type¶
alias of
fobi.base.FormWizardHandlerPlugin
- class fobi.base.FormWizardHandlerPluginWidget(plugin)[source]¶
Bases:
fobi.base.BasePluginWidget
Form wizard handler plugin widget.
- storage¶
alias of
fobi.base.FormWizardHandlerPluginWidgetDataStorage
- class fobi.base.FormWizardHandlerPluginWidgetRegistry[source]¶
Bases:
fobi.base.BasePluginWidgetRegistry
Registry of form wizard handler plugins.
- type¶
- 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¶
- 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
- property registry¶
- class fobi.base.IntegrationFormElementPlugin(user=None)[source]¶
Bases:
fobi.base.BasePlugin
Base custom field instance plugin for integration.
- has_value = False¶
- storage¶
- 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
.
- class fobi.base.IntegrationFormElementPluginRegistry[source]¶
Bases:
fobi.base.BaseIntegrationPluginRegistry
Integration form element plugin registry.
- fail_on_missing_plugin = True¶
- plugin_not_found_exception_cls¶
alias of
fobi.exceptions.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¶
- storage¶
- 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 = True¶
- plugin_not_found_exception_cls¶
alias of
fobi.exceptions.IntegrationFormHandlerPluginDoesNotExist
- type = (<class 'fobi.base.IntegrationFormHandlerPlugin'>,)¶
- fobi.base.assemble_form_field_widget_class(base_class, plugin)[source]¶
Assemble form field widget class.
Finish this or remove.
#TODO
- fobi.base.classproperty¶
alias of
fobi.base.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
- 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
andfobi.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 of 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 of tuple (plugin name, plugin description). If not yet auto-discovered, auto-discovers them.
- Return list
- fobi.base.get_registered_form_element_plugins_grouped(sort_by_value=False)[source]¶
Get registered form element plugins grouped.
Gets a list of registered plugins in a form of tuple (plugin name, plugin description). If not yet auto-discovered, auto-discovers them.
- Return dict
- 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 of 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
- fobi.base.get_theme(request=None, theme_uid=None, as_instance=False)[source]¶
Get theme.
Gets the theme by
theme_uid
given. If left empty, takes the default one chosen insettings
module.Raises a
fobi.exceptions.ThemeDoesNotExist
when no default layout could be found.- Parameters
request (django.http.HttpRequest) –
theme_uid (int) –
as_instance (bool) –
- Return fobi.base.BaseTheme
Subclcass of fobi.base.BaseTheme.
- 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
form_wizard_entry (fobi.models.FormWizardEntry) –
request (django.http.HttpRequest) –
form_list (list) – List of
django.forms.Form
objects.form_wizard (fobi.wizard.views.dynamic.DynamicWizardView) – The form wizard view object.
form_element_entries (iterable) – Iterable of
fobi.base.FormElementEntry
objects.
- Return tuple
List of success responses, list of error responses
- fobi.base.submit_plugin_form_data(form_entry, request, form, 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) –
form (django.forms.Form) –
form_element_entries (iterable) –
- 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.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.data_structures module¶
- class fobi.data_structures.SortableDict(*args, **kwargs)[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 theDjango
, but has several additional methods implemented, such as:insert_before_key
andinsert_after_key
.- 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 thetarget_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 thetarget_key
.- Parameters
target_key (immutable) –
key (immutable) –
value (mutable) –
fail_silently (boolean) –
offset (int) –
- Return bool
- move_after_key(source_key, target_key, fail_silently=True)[source]¶
Move the {
key
:value
} after the givensource_key
.- Parameters
source_key (immutable) –
target_key (immutable) –
fail_silently (boolean) –
- Return bool
fobi.decorators module¶
- 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.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.defaults module¶
fobi.discover module¶
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.
- Parameters
form_wizard_entry –
base_class –
request –
origin –
origin_kwargs_update_func –
origin_return_func –
form_wizard_form_entries –
template_name –
- Returns
fobi.exceptions module¶
- 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:
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¶
- field_properties_mapping = None¶
- field_type_prop_name = None¶
- fields_mapping = None¶
- 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
fobi.form_importers.BaseFormImporter
fobi.form_utils module¶
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
fobi.models.FormElement
- base_fields = {'groups': <django.forms.models.ModelMultipleChoiceField object>, 'groups_action': <django.forms.fields.ChoiceField object>, 'selected_plugins': <django.forms.fields.CharField object>, 'users': <django.forms.models.ModelMultipleChoiceField object>, 'users_action': <django.forms.fields.ChoiceField object>}¶
- declared_fields = {'groups_action': <django.forms.fields.ChoiceField object>, 'selected_plugins': <django.forms.fields.CharField object>, 'users_action': <django.forms.fields.ChoiceField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- 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
fobi.models.FormHandler
- base_fields = {'groups': <django.forms.models.ModelMultipleChoiceField object>, 'groups_action': <django.forms.fields.ChoiceField object>, 'selected_plugins': <django.forms.fields.CharField object>, 'users': <django.forms.models.ModelMultipleChoiceField object>, 'users_action': <django.forms.fields.ChoiceField object>}¶
- declared_fields = {'groups_action': <django.forms.fields.ChoiceField object>, 'selected_plugins': <django.forms.fields.CharField object>, 'users_action': <django.forms.fields.ChoiceField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- 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
fobi.models.FormWizardHandler
- base_fields = {'groups': <django.forms.models.ModelMultipleChoiceField object>, 'groups_action': <django.forms.fields.ChoiceField object>, 'selected_plugins': <django.forms.fields.CharField object>, 'users': <django.forms.models.ModelMultipleChoiceField object>, 'users_action': <django.forms.fields.ChoiceField object>}¶
- declared_fields = {'groups_action': <django.forms.fields.ChoiceField object>, 'selected_plugins': <django.forms.fields.CharField object>, 'users_action': <django.forms.fields.ChoiceField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- class fobi.forms.FormElementEntryForm(data=None, files=None, auto_id='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, renderer=None)[source]¶
Bases:
django.forms.models.ModelForm
FormElementEntry form.
- class Meta[source]¶
Bases:
object
Meta class.
- fields = ('form_entry', 'plugin_data', 'plugin_uid', 'position')¶
- model¶
alias of
fobi.models.FormElementEntry
- base_fields = {'form_entry': <django.forms.models.ModelChoiceField object>, 'plugin_data': <django.forms.fields.CharField object>, 'plugin_uid': <django.forms.fields.ChoiceField object>, 'position': <django.forms.fields.IntegerField object>}¶
- declared_fields = {'plugin_uid': <django.forms.fields.ChoiceField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- fobi.forms.FormElementEntryFormSet¶
alias of
django.forms.formsets.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', 'active_date_from', 'active_date_to', 'inactive_page_title', 'inactive_page_message', 'success_page_title', 'success_page_message', 'action')¶
- model¶
alias of
fobi.models.FormEntry
- base_fields = {'action': <django.forms.fields.CharField object>, 'active_date_from': <django.forms.fields.DateTimeField object>, 'active_date_to': <django.forms.fields.DateTimeField object>, 'inactive_page_message': <django.forms.fields.CharField object>, 'inactive_page_title': <django.forms.fields.CharField object>, 'is_public': <django.forms.fields.BooleanField object>, 'name': <django.forms.fields.CharField object>, 'success_page_message': <django.forms.fields.CharField object>, 'success_page_title': <django.forms.fields.CharField object>, 'title': <django.forms.fields.CharField object>}¶
- declared_fields = {}¶
- property media¶
Return all media required to render the widgets on this form.
- 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
fobi.models.FormFieldsetEntry
- base_fields = {'name': <django.forms.fields.CharField object>}¶
- declared_fields = {}¶
- property media¶
Return all media required to render the widgets on this form.
- class fobi.forms.FormHandlerEntryForm(data=None, files=None, auto_id='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, renderer=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
fobi.models.FormHandlerEntry
- base_fields = {'form_entry': <django.forms.models.ModelChoiceField object>, 'plugin_data': <django.forms.fields.CharField object>, 'plugin_uid': <django.forms.fields.ChoiceField object>}¶
- declared_fields = {'plugin_uid': <django.forms.fields.ChoiceField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- class fobi.forms.FormHandlerForm(data=None, files=None, auto_id='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, renderer=None)[source]¶
Bases:
django.forms.models.ModelForm
FormHandler form.
- class Meta[source]¶
Bases:
object
Meta class.
- fields = ('users', 'groups')¶
- model¶
alias of
fobi.models.FormHandler
- base_fields = {'groups': <django.forms.models.ModelMultipleChoiceField object>, 'users': <django.forms.models.ModelMultipleChoiceField object>}¶
- declared_fields = {}¶
- property media¶
Return all media required to render the widgets on this form.
- 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
fobi.models.FormWizardEntry
- base_fields = {'is_public': <django.forms.fields.BooleanField object>, 'name': <django.forms.fields.CharField object>, 'show_all_navigation_buttons': <django.forms.fields.BooleanField object>, 'success_page_message': <django.forms.fields.CharField object>, 'success_page_title': <django.forms.fields.CharField object>, 'title': <django.forms.fields.CharField object>}¶
- declared_fields = {}¶
- property media¶
Return all media required to render the widgets on this form.
- class fobi.forms.FormWizardFormEntryForm(data=None, files=None, auto_id='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, renderer=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
fobi.models.FormWizardFormEntry
- base_fields = {'form_entry': <django.forms.models.ModelChoiceField object>, 'form_wizard_entry': <django.forms.models.ModelChoiceField object>}¶
- declared_fields = {}¶
- property media¶
Return all media required to render the widgets on this form.
- fobi.forms.FormWizardFormEntryFormSet¶
alias of
django.forms.formsets.FormWizardFormEntryFormFormSet
- class fobi.forms.FormWizardHandlerEntryForm(data=None, files=None, auto_id='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, renderer=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
fobi.models.FormWizardHandlerEntry
- base_fields = {'form_wizard_entry': <django.forms.models.ModelChoiceField object>, 'plugin_data': <django.forms.fields.CharField object>, 'plugin_uid': <django.forms.fields.ChoiceField object>}¶
- declared_fields = {'plugin_uid': <django.forms.fields.ChoiceField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- class fobi.forms.ImportFormEntryForm(data=None, files=None, auto_id='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, renderer=None)[source]¶
Bases:
django.forms.forms.Form
Import form entry form.
- base_fields = {'file': <django.forms.fields.FileField object>}¶
- declared_fields = {'file': <django.forms.fields.FileField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- class fobi.forms.ImportFormWizardEntryForm(data=None, files=None, auto_id='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, renderer=None)[source]¶
Bases:
fobi.forms.ImportFormEntryForm
Import form entry wizard form.
- base_fields = {'file': <django.forms.fields.FileField object>}¶
- declared_fields = {'file': <django.forms.fields.FileField object>}¶
- property media¶
Return all media required to render the widgets on this form.
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).
- class fobi.helpers.JSONDataExporter(data, filename)[source]¶
Bases:
object
Exporting the data into JSON.
- class fobi.helpers.StrippedRequest(request)[source]¶
Bases:
object
Stripped request object.
- property 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.
- 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.
- property 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.
- property email¶
Email.
- 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.ensure_unique_filename(destination)[source]¶
Makes sure filenames are never overwritten.
- Parameters
destination (string) –
- Return string
- fobi.helpers.extract_file_path(name)[source]¶
Extracts the file path.
- Parameters
name (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_ignorable_form_values()[source]¶
Get ignorable for form values.
Gets an iterable of form values to ignore.
- Return iterable
- 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 (exampleauth.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
- 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.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
plugin_form (fobi.base.BaseFormFieldPluginForm) –
field_name_choices (str) –
field_name_initial (str) –
- 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
plugin_form (fobi.base.BaseFormFieldPluginForm) –
field_name_choices (str) –
field_name_initial (str) –
- Return str
fobi.models module¶
- 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.
- property entry_user¶
Get user.
- form_wizard_entry¶
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- 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.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.
- property entry_user¶
Get user.
- form_entry¶
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- 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.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.
- 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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- groups_list()[source]¶
Groups list.
Flat list (comma separated string) of groups allowed to use the plugin. Used in Django admin.
- Return string
- 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
andTopping.pizzas
areManyToManyDescriptor
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.
- property entry_user¶
Get user from the parent container.
- 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 inplugin_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
.
- plugin_data¶
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.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 MultipleObjectsReturned¶
Bases:
django.core.exceptions.MultipleObjectsReturned
- 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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- id¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- objects = <django.db.models.manager.Manager object>¶
- plugin_uid¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- 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
andTopping.pizzas
areManyToManyDescriptor
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.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 MultipleObjectsReturned¶
Bases:
django.core.exceptions.MultipleObjectsReturned
- form_entry¶
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- form_fieldset_entry¶
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- 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.
- id¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- objects = <django.db.models.manager.Manager object>¶
- plugin_uid¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- 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.FormEntry(*args, **kwargs)[source]¶
Bases:
django.db.models.base.Model
Form entry.
- exception DoesNotExist¶
Bases:
django.core.exceptions.ObjectDoesNotExist
- exception MultipleObjectsReturned¶
Bases:
django.core.exceptions.MultipleObjectsReturned
- action¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- active_date_from¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- active_date_to¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- created¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- 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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- get_absolute_url()[source]¶
Get absolute URL.
Absolute URL, which goes to the form-entry view view page.
- Return string
- id¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- inactive_page_message¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- inactive_page_title¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- property is_active¶
- is_cloneable¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- is_public¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- name¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- objects = <django.db.models.manager.Manager object>¶
- 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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- slug¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- 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.
- 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.
- title¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- updated¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- user¶
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- 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.FormFieldsetEntry(*args, **kwargs)[source]¶
Bases:
django.db.models.base.Model
Form fieldset entry.
- exception DoesNotExist¶
Bases:
django.core.exceptions.ObjectDoesNotExist
- exception MultipleObjectsReturned¶
Bases:
django.core.exceptions.MultipleObjectsReturned
- form_entry¶
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- 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.
- 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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- id¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- is_repeatable¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- name¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- objects = <django.db.models.manager.Manager object>¶
- 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 MultipleObjectsReturned¶
Bases:
django.core.exceptions.MultipleObjectsReturned
- 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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- id¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- objects = <django.db.models.manager.Manager object>¶
- plugin_uid¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- 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
andTopping.pizzas
areManyToManyDescriptor
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.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 MultipleObjectsReturned¶
Bases:
django.core.exceptions.MultipleObjectsReturned
- form_entry¶
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- id¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- objects = <django.db.models.manager.Manager object>¶
- 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.FormWizardEntry(*args, **kwargs)[source]¶
Bases:
django.db.models.base.Model
Form wizard entry.
- exception DoesNotExist¶
Bases:
django.core.exceptions.ObjectDoesNotExist
- exception MultipleObjectsReturned¶
Bases:
django.core.exceptions.MultipleObjectsReturned
- created¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- 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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- get_absolute_url()[source]¶
Get absolute URL.
Absolute URL, which goes to the form-wizard view view.
- Return string
- get_wizard_type_display(*, field=<django.db.models.fields.CharField: wizard_type>)¶
- id¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- is_cloneable¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- is_public¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- name¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- objects = <django.db.models.manager.Manager object>¶
- 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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- slug¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- 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.
- 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.
- title¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- updated¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- user¶
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- user_id¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- 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.FormWizardFormEntry(*args, **kwargs)[source]¶
Bases:
django.db.models.base.Model
Form wizard form entry.
A coupling point between FormWizardEntry and FormEntry.
- exception DoesNotExist¶
Bases:
django.core.exceptions.ObjectDoesNotExist
- exception MultipleObjectsReturned¶
Bases:
django.core.exceptions.MultipleObjectsReturned
- form_entry¶
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- 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.
- form_wizard_entry¶
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- 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.
- id¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- objects = <django.db.models.manager.Manager object>¶
- 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.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 MultipleObjectsReturned¶
Bases:
django.core.exceptions.MultipleObjectsReturned
- 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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- id¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- objects = <django.db.models.manager.Manager object>¶
- plugin_uid¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- 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
andTopping.pizzas
areManyToManyDescriptor
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.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 MultipleObjectsReturned¶
Bases:
django.core.exceptions.MultipleObjectsReturned
- form_wizard_entry¶
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- id¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- objects = <django.db.models.manager.Manager object>¶
- 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.append_edit_and_delete_links_to_field(form_element_plugin, form_element_entry, origin=None, extra={}, widget_cls=None)[source]¶
Append edit and delete links to the field.
Should return dictionary, which would be used to update default kwargs of form fields.
The hidden inputs form-{counter}-position and form-{counter}-id are for saving the ordering of the elements (position field).
- Return dict
- fobi.utils.get_allowed_form_element_plugin_uids(user)[source]¶
Get allowed 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_allowed_plugin_uids(plugin_model_cls, user)[source]¶
Get allowed plugins uids for user given.
- Parameters
plugin_model_cls (fobi.models.AbstractPluginModel) – Subclass of
fobi.models.AbstractPluginModel
.user (django.contrib.auth.models.User) –
- Return list
- fobi.utils.get_user_form_element_plugins_grouped(user, sort_by_value=False)[source]¶
Get user form element plugins grouped.
- fobi.utils.get_user_form_field_plugin_uids(user)¶
Get user form element 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_handler_plugins_grouped(user, sort_by_value=False)[source]¶
Get user form handler plugins grouped.
- fobi.utils.get_user_form_wizard_handler_plugin_uids(user)[source]¶
Get user form handler plugin uids.
- 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_wizard_handler_plugins_grouped(user)[source]¶
Get user form wizard handler plugins grouped.
- 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.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_plugins_grouped(get_allowed_plugin_uids_func, get_registered_plugins_grouped_func, registry, user, sort_items=True, sort_by_value=False)[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) –
sort_by_value (bool) –
- Return dict
- fobi.utils.get_wizard_files_upload_dir()[source]¶
Get absolute path to the upload directory of fobi form wizard files.
If WIZARD_FILES_UPLOAD_DIR path is absolute, return as is. Otherwise, prepend BASE_PATH.
- Return str
Absolute path.
- 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.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.validators module¶
fobi.views module¶
fobi.widgets module¶
- 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)
- property media¶
- class fobi.widgets.NumberInput(attrs=None)[source]¶
Bases:
django.forms.widgets.Input
- input_type = 'number'¶
- property media¶
- template_name = 'django/forms/widgets/number.html'¶
- 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.
- property media¶
- 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.
- property media¶
- option_template_name = 'fobi/django/forms/widgets/rich_select_inverse_option.html'¶
- template_name = 'fobi/django/forms/widgets/rich_select_inverse.html'¶