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 1.11, 2.0, 2.1, 2.2 and 3.0.
- Python 3.5, 3.6, 3.7 and 3.8.
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.
- 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.
- Class based views.
- 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:
- URL: http://127.0.0.1:8001/fobi/
- Admin username: test_admin
- Admin password: test
Django admin interface:
- URL: http://127.0.0.1:8001/admin/
- 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
and
fobi.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 in
context_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 the INSTALLED_APPS
, you should mention the following in urls
module.
# DB Store plugin URLs
url(r'^fobi/plugins/form-handlers/db-store/',
include('fobi.contrib.plugins.form_handlers.db_store.urls')),
View URLs are put separately from edit URLs in order to make it possible to prefix the edit URLs differently. For example, if you’re using the “Simple” theme, you would likely want to prefix the edit URLs with “admin/” so that it looks more like django-admin.
Creating a new form element plugin¶
Form element plugins represent the elements of which the forms is made: Inputs, checkboxes, textareas, files, hidden fields, as well as pure presentational elements (text or image). Number of form elements in a form is not limited.
Presentational form elements are inherited from fobi.base.FormElementPlugin
.
The rest (real form elements, that are supposed to have a value)
are inherited from fobi.base.FormFieldPlugin
.
You should see a form element plugin as a Django micro app, which could have its’ own models, admin interface, etc.
django-fobi comes with several bundled form element plugins. Do check the source code as example.
Let’s say, you want to create a textarea form element plugin.
There are several properties, each textarea should have. They are:
- label (string): HTML label of the textarea.
- name (string): HTML name of the textarea.
- initial (string): Initial value of the textarea.
- required (bool): Flag, which tells us whether the field is required or optional.
Let’s name that plugin sample_textarea
. The plugin directory should then
have the following structure.
path/to/sample_textarea/
├── __init__.py
├── fobi_form_elements.py # Where plugins are defined and registered
├── forms.py # Plugin configuration form
└── widgets.py # Where plugins widgets are defined
Form element plugins should be registered in “fobi_form_elements.py” file. Each
plugin module should be put into the INSTALLED_APPS
of your Django
projects’ settings.
In some cases, you would need plugin specific overridable settings (see
fobi.contrib.form_elements.fields.content.content_image
plugin as an
example). You are advised to write your settings in such a way, that variables
of your Django project settings module would have FOBI_PLUGIN_ prefix.
Define and register the form element plugin¶
Step by step review of a how to create and register a plugin and plugin
widgets. Note, that django-fobi auto-discovers your plugins if you place
them into a file named fobi_form_elements.py
of any Django app listed in
INSTALLED_APPS
of your Django projects’ settings module.
path/to/sample_textarea/fobi_form_elements.py¶
A single form element plugin is registered by its’ UID.
Required imports.
from django import forms
from fobi.base import FormFieldPlugin, form_element_plugin_registry
from path.to.sample_textarea.forms import SampleTextareaForm
Defining the Sample textarea plugin.
class SampleTextareaPlugin(FormFieldPlugin):
"""Sample textarea plugin."""
uid = "sample_textarea"
name = "Sample Textarea"
form = SampleTextareaForm
group = "Samples" # Group to which the plugin belongs to
def get_form_field_instances(self,
request=None,
form_entry=None,
form_element_entries=None,
**kwargs):
kwargs = {
'required': self.data.required,
'label': self.data.label,
'initial': self.data.initial,
'widget': forms.widgets.Textarea(attrs={})
}
return [(self.data.name, forms.CharField, kwargs),]
Registering the SampleTextareaPlugin
plugin.
form_element_plugin_registry.register(SampleTextareaPlugin)
Note, that in case you want to define a pure presentational element, make use
of fobi.base.FormElementPlugin
for subclassing, instead of
fobi.base.FormFieldPlugin
.
See the source of the content plugins
(fobi.contrib.plugins.form_elements.content) as a an example.
For instance, the captcha
and honeypot
fields are implemented
as form elements (subclasses the fobi.base.FormElementPlugin
). The
db_store
form handler plugin does not save the form data of
those elements. If you want the form element data to be saved, do inherit
from fobi.base.FormFieldPlugin
.
Hidden form element plugins, should be also having set the is_hidden
property to True. By default it’s set to False. That makes the hidden
form elements to be rendered using as django.forms.widgets.TextInput
widget in edit mode. In the view mode, the original widget that you
assigned in your form element plugin would be used.
There might be cases, when you need to do additional handling of the data upon
the successful form submission. In such cases, you will need to define a
submit_plugin_form_data
method in the plugin, which accepts the
following arguments:
- form_entry (fobi.models.FormEntry): Form entry, which is being submitted.
- request (django.http.HttpRequest): The Django HTTP request.
- form (django.forms.Form): Form object (a valid one, which contains
the
cleaned_data
attribute). - form_element_entries (fobi.models.FormElementEntry): Form element entries for the form_entry given.
- (**)kwargs : Additional arguments.
Example (taken from fobi.contrib.plugins.form_elements.fields.file):
def submit_plugin_form_data(self,
form_entry,
request,
form,
form_element_entries=None,
**kwargs):
"""Submit plugin form data."""
# Get the file path
file_path = form.cleaned_data.get(self.data.name, None)
if file_path:
# Handle the upload
saved_file = handle_uploaded_file(FILES_UPLOAD_DIR, file_path)
# Overwrite ``cleaned_data`` of the ``form`` with path to moved
# file.
form.cleaned_data[self.data.name] = "{0}{1}".format(
settings.MEDIA_URL, saved_file
)
# It's critically important to return the ``form`` with updated
# ``cleaned_data``
return form
In the example below, the original form is being modified. If you don’t want the original form to be modified, do not return anything.
Check the file form element plugin (fobi.contrib.plugins.form_elements.fields.file) for complete example.
path/to/sample_textarea/forms.py¶
Why to have another file for defining forms? Just to keep the code clean and
less messy, although you could perfectly define all your plugin forms in the
module fobi_form_elements.py
, it’s recommended to keep it separate.
Take into consideration, that forms.py
is not an auto-discovered file
pattern. All your form element plugins should be registered in modules named
fobi_form_elements.py
.
Required imports.
from django import forms
from fobi.base import BasePluginForm
Form for for SampleTextareaPlugin
form element plugin.
class SampleTextareaForm(forms.Form, BasePluginForm):
"""Sample textarea form."""
plugin_data_fields = [
("name", ""),
("label", ""),
("initial", ""),
("required", False)
]
name = forms.CharField(label="Name", required=True)
label = forms.CharField(label="Label", required=True)
initial = forms.CharField(label="Initial", required=False)
required = forms.BooleanField(label="Required", required=False)
Note that although it’s not being checked in the code, but for form
field plugins the following fields should be present in the plugin
form (BasePluginForm
) and the form plugin (FormFieldPlugin
):
- name
In some cases, you might want to do something with the data
before it gets saved. For that purpose, save_plugin_data
method
has been introduced.
See the following example.
def save_plugin_data(self, request=None):
"""Saving the plugin data and moving the file."""
file_path = self.cleaned_data.get('file', None)
if file_path:
saved_image = handle_uploaded_file(IMAGES_UPLOAD_DIR, file_path)
self.cleaned_data['file'] = saved_image
path/to/sample_textarea/widgets.py¶
Required imports.
from fobi.base import FormElementPluginWidget
Defining the base plugin widget.
class BaseSampleTextareaPluginWidget(FormElementPluginWidget):
"""Base sample textarea plugin widget."""
# Same as ``uid`` value of the ``SampleTextareaPlugin``.
plugin_uid = "sample_textarea"
path/to/sample_layout/fobi_form_elements.py¶
Register in the registry (in some module which is for sure to be loaded; it’s handy to do it in the theme module).
Required imports.
from fobi.base import form_element_plugin_widget_registry
from path.to.sample_textarea.widgets import BaseSampleTextareaPluginWidget
Define the theme specific plugin.
class SampleTextareaPluginWidget(BaseSampleTextareaPluginWidget):
"""Sample textarea plugin widget."""
theme_uid = 'bootstrap3' # Theme for which the widget is loaded
media_js = [
'sample_layout/js/fobi.plugins.form_elements.sample_textarea.js',
]
media_css = [
'sample_layout/css/fobi.plugins.form_elements.sample_textarea.css',
]
Register the widget.
form_element_plugin_widget_registry.register(SampleTextareaPluginWidget)
Form element plugin final steps¶
Now, that everything is ready, make sure your plugin module is added to
INSTALLED_APPS
.
INSTALLED_APPS = (
# ...
'path.to.sample_textarea',
# ...
)
Afterwards, go to terminal and type the following command.
./manage.py fobi_sync_plugins
If your HTTP server is running, you would then be able to see the new plugin in the edit form interface.
Dashboard URL: http://127.0.0.1:8000/fobi/
Note, that you have to be logged in, in order to use the dashboard. If your
new plugin doesn’t appear, set the FOBI_DEBUG
to True in your Django’s
local settings module, re-run your code and check console for error
notifications.
Creating a new form handler plugin¶
Form handler plugins handle the form data. django-fobi comes with several
bundled form handler plugins, among which is the db_store
and mail
plugins, which are responsible for saving the submitted form data into the
database and mailing the data to recipients specified. Number of form handlers
in a form is not limited. Certain form handlers are not configurable (for
example the db_store
form handler isn’t), while others are (mail
,
http_repost
).
You should see a form handler as a Django micro app, which could have its’ own models, admin interface, etc.
By default, it’s possible to use a form handler plugin multiple times per form.
If you wish to allow form handler plugin to be used only once in a form,
set the allow_multiple
property of the plugin to False.
As said above, django-fobi comes with several bundled form handler plugins. Do check the source code as example.
Define and register the form handler plugin¶
Let’s name that plugin sample_mail
. The plugin directory should then have
the following structure.
path/to/sample_mail/
├── __init__.py
├── fobi_form_handlers.py # Where plugins are defined and registered
└── forms.py # Plugin configuration form
Form handler plugins should be registered in “fobi_form_handlers.py” file.
Each plugin module should be put into the INSTALLED_APPS
of your Django
projects’ settings.
path/to/sample_mail/fobi_form_handlers.py¶
A single form handler plugin is registered by its’ UID.
Required imports.
import json
from django.core.mail import send_mail
from fobi.base import FormHandlerPlugin, form_handler_plugin_registry
from path.to.sample_mail.forms import SampleMailForm
Defining the Sample mail handler plugin.
class SampleMailHandlerPlugin(FormHandlerPlugin):
"""Sample mail handler plugin."""
uid = "sample_mail"
name = _("Sample mail")
form = SampleMailForm
def run(self, form_entry, request, form, 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 ugettext_lazy as _
from fobi.base import BasePluginForm
Defining the form for Sample mail handler plugin.
class MailForm(forms.Form, BasePluginForm):
"""Mail form."""
plugin_data_fields = [
("from_name", ""),
("from_email", ""),
("to_name", ""),
("to_email", ""),
("subject", ""),
("body", ""),
]
from_name = forms.CharField(label=_("From name"), required=True)
from_email = forms.EmailField(label=_("From email"), required=True)
to_name = forms.CharField(label=_("To name"), required=True)
to_email = forms.EmailField(label=_("To email"), required=True)
subject = forms.CharField(label=_("Subject"), required=True)
body = forms.CharField(
label=_("Body"),
required=False,
widget=forms.widgets.Textarea
)
After the plugin has been processed, all its’ data is available in a
plugin_instance.data
container (for example,
plugin_instance.data.subject
or plugin_instance.data.from_name
).
Prioritise the execution order¶
Some form handlers shall be executed prior others. A good example of such, is
a combination of “mail” and “db_save” form handlers for the form. In case if
large files are posted, submission of form data would fail if “mail” plugin
would be executed after “db_save” has been executed. That’s why it’s possible
to prioritise that ordering in a FOBI_FORM_HANDLER_PLUGINS_EXECUTION_ORDER
setting variable.
If not specified or left empty, form handler plugins would be ran in the order
of discovery. All form handler plugins that are not listed in the
FORM_HANDLER_PLUGINS_EXECUTION_ORDER
, would be ran after the plugins that
are mentioned there.
FORM_HANDLER_PLUGINS_EXECUTION_ORDER = (
'http_repost',
'mail',
# The 'db_store' is left out intentionally, since it should
# be the last plugin to be executed.
)
Form handler plugin custom actions¶
By default, a single form handler plugin has at least a “delete” action. If plugin is configurable, it gets an “edit” action as well.
For some of your plugins, you may want to register a custom action. For example, the “db_store” plugin does have one, for showing a link to a listing page with saved form data for the form given.
For such cases, define a custom_actions
method in your form handler
plugin. That method shall return a list of triples. In each triple,
first value is the URL, second value is the title and the third value
is the icon of the URL.
The following example is taken from the “db_store” plugin.
def custom_actions(self):
"""Adding a link to view the saved form entries.
:return iterable:
"""
return (
(
reverse('fobi.contrib.plugins.form_handlers.db_store.view_saved_form_data_entries'),
_("View entries"),
'glyphicon glyphicon-list'
),
)
Form handler plugin final steps¶
Do not forget to add the form handler plugin module to INSTALLED_APPS
.
INSTALLED_APPS = (
# ...
'path.to.sample_mail',
# ...
)
Afterwards, go to terminal and type the following command.
./manage.py fobi_sync_plugins
If your HTTP server is running, you would then be able to see the new plugin in the edit form interface.
Creating a new form importer plugin¶
Form importer plugins import the forms from some external data source into django-fobi form format. Number of form importers is not limited. Form importers are implemented in forms of wizards (since they may contain several steps).
You should see a form importer as a Django micro app, which could have its’ own models, admin interface, etc.
At the moment django-fobi comes with only one bundled form handler plugin,
which is the mailchimp_importer
, which is responsible for importing
existing MailChimp forms into django-fobi.
Define and register the form importer plugin¶
Let’s name that plugin sample_importer
. The plugin directory should then
have the following structure.
path/to/sample_importer/
├── templates
│ └── sample_importer
│ ├── 0.html
│ └── 1.html
├── __init__.py
├── fobi_form_importers.py # Where plugins are defined and registered
├── forms.py # Wizard forms
└── views.py # Wizard views
Form importer plugins should be registered in “fobi_form_importers.py” file.
Each plugin module should be put into the INSTALLED_APPS
of your Django
projects’ settings.
path/to/sample_importer/fobi_form_importers.py¶
A single form importer plugin is registered by its’ UID.
Required imports.
from django.utils.translation import ugettext_lazy as _
from fobi.form_importers import BaseFormImporter, form_importer_plugin_registry
from fobi.contrib.plugins.form_elements import fields
from path.to.sample_importer.views import SampleImporterWizardView
Defining the Sample importer plugin.
class SampleImporterPlugin(FormHandlerPlugin):
"""Sample importer plugin."""
uid = 'sample_importer'
name = _("Sample importer")
wizard = SampleImporterWizardView
templates = [
'sample_importer/0.html',
'sample_importer/1.html',
]
# field_type (at importer): uid (django-fobi)
fields_mapping = {
# Implemented
'email': fields.email.UID,
'text': fields.text.UID,
'number': fields.integer.UID,
'dropdown': fields.select.UID,
'date': fields.date.UID,
'url': fields.url.UID,
'radio': fields.radio.UID,
# Transformed into something else
'address': fields.text.UID,
'zip': fields.text.UID,
'phone': fields.text.UID,
}
# Django standard: remote
field_properties_mapping = {
'label': 'name',
'name': 'tag',
'help_text': 'helptext',
'initial': 'default',
'required': 'req',
'choices': 'choices',
}
field_type_prop_name = 'field_type'
position_prop_name = 'order'
def extract_field_properties(self, field_data):
field_properties = {}
for prop, val in self.field_properties_mapping.items():
if val in field_data:
if 'choices' == val:
field_properties[prop] = "\n".join(field_data[val])
else:
field_properties[prop] = field_data[val]
return field_properties
form_importer_plugin_registry.register(SampleImporter)
path/to/sample_importer/forms.py¶
As mentioned above, form importers are implemented in form of wizards. The forms are the wizard steps.
Required imports.
from django import forms
from django.utils.translation import ugettext_lazy as _
from sample_service_api import sample_api # Just an imaginary API client
Defining the form for Sample importer plugin.
class SampleImporterStep1Form(forms.Form):
"""First form the the wizard."""
api_key = forms.CharField(required=True)
class SampleImporterStep2Form(forms.Form):
"""Second form of the wizard."""
list_id = forms.ChoiceField(required=True, choices=[])
def __init__(self, *args, **kwargs):
self._api_key = None
if 'api_key' in kwargs:
self._api_key = kwargs.pop('api_key', None)
super(SampleImporterStep2Form, self).__init__(*args, **kwargs)
if self._api_key:
client = sample_api.Api(self._api_key)
lists = client.lists.list()
choices = [(l['id'], l['name']) for l in lists['data']]
self.fields['list_id'].choices = choices
path/to/sample_importer/views.py¶
The wizard views.
Required imports.
from sample_service_api import sample_api # Just an imaginary API client
from django.shortcuts import redirect
from django.core.urlresolvers import reverse
from django.contrib import messages
from django.utils.translation import ugettext_lazy as _
# For django LTE 1.8 import from `django.contrib.formtools.wizard.views`
from formtools.wizard.views import SessionWizardView
from path.to.sample_importer.forms import (
SampleImporterStep1Form,
SampleImporterStep2Form,
)
Defining the wizard view for Sample importer plugin.
class SampleImporterWizardView(SessionWizardView):
"""Sample importer wizard view."""
form_list = [SampleImporterStep1Form, SampleImporterStep2Form]
def get_form_kwargs(self, step):
"""Get form kwargs (to be used internally)."""
if '1' == step:
data = self.get_cleaned_data_for_step('0') or {}
api_key = data.get('api_key', None)
return {'api_key': api_key}
return {}
def done(self, form_list, **kwargs):
"""After all forms are submitted."""
# Merging cleaned data into one dict
cleaned_data = {}
for form in form_list:
cleaned_data.update(form.cleaned_data)
# Connecting to sample client API
client = sample_client.Api(cleaned_data['api_key'])
# Fetching the form data
form_data = client.lists.merge_vars(
id={'list_id': cleaned_data['list_id']}
)
# We need the first form only
try:
form_data = form_data['data'][0]
except Exception as err:
messages.warning(
self.request,
_('Selected form could not be imported due errors.')
)
return redirect(reverse('fobi.dashboard'))
# Actually, import the form
form_entry = self._form_importer.import_data(
{'name': form_data['name'], 'user': self.request.user},
form_data['merge_vars']
)
redirect_url = reverse(
'fobi.edit_form_entry',
kwargs={'form_entry_id': form_entry.pk}
)
messages.info(
self.request,
_('Form {0} imported successfully.').format(form_data['name'])
)
return redirect("{0}".format(redirect_url))
Form importer plugin final steps¶
Do not forget to add the form importer plugin module to INSTALLED_APPS
.
INSTALLED_APPS = (
# ...
'path.to.sample_importer',
# ...
)
Afterwards, go to terminal and type the following command.
./manage.py fobi_sync_plugins
If your HTTP server is running, you would then be able to see the new plugin in the dashboard form interface (implemented in all bundled themes).
Creating a form callback¶
Form callbacks are additional hooks, that are executed on various stages of the form submission.
Let’s place the callback in the foo
module. The plugin directory should
then have the following structure.
path/to/foo/
├── __init__.py
└── fobi_form_callbacks.py # Where callbacks are defined and registered
See the callback example below.
Required imports.
from fobi.constants import (
CALLBACK_BEFORE_FORM_VALIDATION,
CALLBACK_FORM_VALID_BEFORE_SUBMIT_PLUGIN_FORM_DATA,
CALLBACK_FORM_VALID, CALLBACK_FORM_VALID_AFTER_FORM_HANDLERS,
CALLBACK_FORM_INVALID
)
from fobi.base import FormCallback, form_callback_registry
Define and register the callback
class SampleFooCallback(FormCallback):
"""Sample foo callback."""
stage = CALLBACK_FORM_VALID
def callback(self, form_entry, request, form):
"""Define your callback code here."""
print("Great! Your form is valid!")
form_callback_registry.register(SampleFooCallback)
Add the callback module to INSTALLED_APPS
.
INSTALLED_APPS = (
# ...
'path.to.foo',
# ...
)
Suggestions¶
Custom action for the form¶
Sometimes, you would want to specify a different action for the form.
Although it’s possible to define a custom form action (action
field
in the “Form properties” tab), you’re advised to use the http_repost
plugin instead, since then the form would be still validated locally
and only then the valid data, as is, would be sent to the desired
endpoint.
Take in mind, that if both cases, if CSRF protection is enabled on the endpoint, your post request would result an error.
When you want to customise too many things¶
django-fobi, with its’ flexible form elements, form handlers and form
callbacks is very customisable. However, there might be cases when you need to
override entire view to fit your needs. Take a look at the
FeinCMS integration
or DjangoCMS integration
as a good example of such. You may also want to compare the code from original
view fobi.views.view_form_entry
with the code from the widget to get a
better idea of what could be changed in your case. If need a good advice,
just ask me.
Theming¶
django-fobi comes with theming API. While there are several ready-to-use themes:
- “Bootstrap 3” theme
- “Foundation 5” theme
- “Simple” theme in (with editing interface in style of the Django admin)
- “DjangoCMS admin style” theme (which is another simple theme with editing
interface in style of
djangocms-admin-style
)
Obviously, there are two sorts of views when it comes to editing and viewing the form.
- The “view-view”, when the form as it has been made is exposed to the site end- users/visitors.
- The “edit-view” (builder view), where the authorised users build their forms.
Both “Bootstrap 3” and “Foundation 5” themes are making use of the same style for both “view-view” and “edit-view” views.
Both “Simple” and “DjangoCMS admin style” themes are styling for the “edit-view” only. The “view-view” is pretty much blank, as shown on the one of the screenshots [2.6].
Have in mind, that creating a brand new theme could be time consuming. Instead, you are advised to extend existing themes or in the worst case, if too much customisation required, create your own themes based on existing ones (just copy the desired theme to your project directory and work it out further).
It’s possible to use different templates for all “view” and “edit” actions (see the source code of the “simple” theme). Both “Bootstrap 3” and “Foundation 5” themes look great. Although if you can’t use any of those, the “Simple” theme is the best start, since it looks just like django-admin.
Create a new theme¶
Let’s place the theme in the sample_theme
module. The theme directory
should then have the following structure.
path/to/sample_theme/
├── static
│ ├── css
│ │ └── sample_theme.css
│ └── js
│ └── sample_theme.js
├── templates
│ └── sample_theme
│ ├── _base.html
│ ├── add_form_element_entry.html
│ ├── ...
│ └── view_form_entry_ajax.html
├── __init__.py
├── fobi_form_elements.py
└── fobi_themes.py # Where themes are defined and registered
See the theme example below.
from django.utils.translation import ugettext_lazy as _
from fobi.base import BaseTheme, theme_registry
class SampleTheme(BaseTheme):
"""Sample theme."""
uid = 'sample'
name = _("Sample")
media_css = (
'sample_theme/css/sample_theme.css',
'css/fobi.core.css',
)
media_js = (
'js/jquery-1.10.2.min.js',
'jquery-ui/js/jquery-ui-1.10.3.custom.min.js',
'js/jquery.slugify.js',
'js/fobi.core.js',
'sample_theme/js/sample_theme.js',
)
# Form element specific
form_element_html_class = 'form-control'
form_radio_element_html_class = 'radio'
form_element_checkbox_html_class = 'checkbox'
form_edit_form_entry_option_class = 'glyphicon glyphicon-edit'
form_delete_form_entry_option_class = 'glyphicon glyphicon-remove'
form_list_container_class = 'list-inline'
# Templates
master_base_template = 'sample_theme/_base.html'
base_template = 'sample_theme/base.html'
form_ajax = 'sample_theme/snippets/form_ajax.html'
form_snippet_template_name = 'sample_theme/snippets/form_snippet.html'
form_properties_snippet_template_name = 'sample_theme/snippets/form_properties_snippet.html'
messages_snippet_template_name = 'sample_theme/snippets/messages_snippet.html'
add_form_element_entry_template = 'sample_theme/add_form_element_entry.html'
add_form_element_entry_ajax_template = 'sample_theme/add_form_element_entry_ajax.html'
add_form_handler_entry_template = 'sample_theme/add_form_handler_entry.html'
add_form_handler_entry_ajax_template = 'sample_theme/add_form_handler_entry_ajax.html'
create_form_entry_template = 'sample_theme/create_form_entry.html'
create_form_entry_ajax_template = 'bootstrap3/create_form_entry_ajax.html'
dashboard_template = 'sample_theme/dashboard.html'
edit_form_element_entry_template = 'sample_theme/edit_form_element_entry.html'
edit_form_element_entry_ajax_template = 'sample_theme/edit_form_element_entry_ajax.html'
edit_form_entry_template = 'sample_theme/edit_form_entry.html'
edit_form_entry_ajax_template = 'sample_theme/edit_form_entry_ajax.html'
edit_form_handler_entry_template = 'sample_theme/edit_form_handler_entry.html'
edit_form_handler_entry_ajax_template = 'sample_theme/edit_form_handler_entry_ajax.html'
form_entry_submitted_template = 'sample_theme/form_entry_submitted.html'
form_entry_submitted_ajax_template = 'sample_theme/form_entry_submitted_ajax.html'
view_form_entry_template = 'sample_theme/view_form_entry.html'
view_form_entry_ajax_template = 'sample_theme/view_form_entry_ajax.html'
Registering the SampleTheme
plugin.
theme_registry.register(SampleTheme)
Sometimes you would want to attach additional properties to the theme
in order to use them later in templates (remember, current theme object
is always available in templates under name fobi_theme
).
For such cases you would need to define a variable in your project’s settings
module, called FOBI_CUSTOM_THEME_DATA
. See the following code as example:
# `django-fobi` custom theme data for to be displayed in third party apps
# like `django-registraton`.
FOBI_CUSTOM_THEME_DATA = {
'bootstrap3': {
'page_header_html_class': '',
'form_html_class': 'form-horizontal',
'form_button_outer_wrapper_html_class': 'control-group',
'form_button_wrapper_html_class': 'controls',
'form_button_html_class': 'btn',
'form_primary_button_html_class': 'btn-primary pull-right',
},
'foundation5': {
'page_header_html_class': '',
'form_html_class': 'form-horizontal',
'form_button_outer_wrapper_html_class': 'control-group',
'form_button_wrapper_html_class': 'controls',
'form_button_html_class': 'radius button',
'form_primary_button_html_class': 'btn-primary',
},
'simple': {
'page_header_html_class': '',
'form_html_class': 'form-horizontal',
'form_button_outer_wrapper_html_class': 'control-group',
'form_button_wrapper_html_class': 'submit-row',
'form_button_html_class': 'btn',
'form_primary_button_html_class': 'btn-primary',
}
}
You would now be able to access the defined extra properties in templates as shown below.
<div class="{{ fobi_theme.custom_data.form_button_wrapper_html_class }}">
You likely would want to either remove the footer text or change it. Define
a variable in your project’s settings module, called FOBI_THEME_FOOTER_TEXT
.
See the following code as example:
FOBI_THEME_FOOTER_TEXT = gettext('© 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 ugettext_lazy as _
from rest_framework.fields import EmailField
from fobi.base import IntegrationFormFieldPlugin
from fobi.contrib.apps.drf_integration import UID as INTEGRATE_WITH_UID
from fobi.contrib.apps.drf_integration.base import (
DRFIntegrationFormElementPluginProcessor,
DRFSubmitPluginFormDataMixin,
)
from fobi.contrib.apps.drf_integration.form_elements.fields.email import UID
class EmailInputPlugin(IntegrationFormFieldPlugin,
DRFSubmitPluginFormDataMixin):
"""EmailField plugin."""
uid = UID
integrate_with = INTEGRATE_WITH_UID
name = _("Decimal")
group = _("Fields")
def get_custom_field_instances(self,
form_element_plugin,
request=None,
form_entry=None,
form_element_entries=None,
**kwargs):
"""Get form field instances."""
field_kwargs = {
'required': form_element_plugin.data.required,
'initial': form_element_plugin.data.initial,
'label': form_element_plugin.data.label,
'help_text': form_element_plugin.data.help_text,
'max_length': form_element_plugin.data.max_length,
}
return [
DRFIntegrationFormElementPluginProcessor(
field_class=EmailField,
field_kwargs=field_kwargs
)
]
fobi_integration_form_elements.py¶
Register the plugin. Note the name pattern fobi_integration_form_elements.
from fobi.base import integration_form_element_plugin_registry
from .base import EmailInputPlugin
integration_form_element_plugin_registry.register(EmailInputPlugin)
Don’t forget to list your plugin in the INSTALLED_APPS
afterwards.
Sample IntegrationFormHandlerPlugin¶
Sample is taken from here.
base.py¶
Define the form handler plugin.
import logging
from mimetypes import guess_type
import os
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from fobi.base import IntegrationFormHandlerPlugin
from fobi.helpers import extract_file_path
from fobi.contrib.apps.drf_integration import UID as INTEGRATE_WITH_UID
from fobi.contrib.apps.drf_integration.base import get_processed_serializer_data
from . import UID
class MailHandlerPlugin(IntegrationFormHandlerPlugin):
"""Mail handler form handler plugin.
Can be used only once per form.
"""
uid = UID
name = _("Mail")
integrate_with = INTEGRATE_WITH_UID
def run(self,
form_handler_plugin,
form_entry,
request,
form_element_entries=None,
**kwargs):
"""Run."""
base_url = form_handler_plugin.get_base_url(request)
serializer = kwargs['serializer']
# Clean up the values, leave our content fields and empty values.
field_name_to_label_map, cleaned_data = get_processed_serializer_data(
serializer,
form_element_entries
)
rendered_data = form_handler_plugin.get_rendered_data(
serializer.validated_data,
field_name_to_label_map,
base_url
)
files = self._prepare_files(request, serializer)
form_handler_plugin.send_email(rendered_data, files)
def _prepare_files(self, request, serializer):
"""Prepares the files for being attached to the mail message."""
files = {}
def process_path(file_path, imf):
"""Processes the file path and the file."""
if file_path:
file_path = file_path.replace(
settings.MEDIA_URL,
os.path.join(settings.MEDIA_ROOT, '')
)
mime_type = guess_type(imf.name)
files[field_name] = (
imf.name,
''.join([c for c in imf.chunks()]),
mime_type[0] if mime_type else ''
)
for field_name, imf in request.FILES.items():
try:
file_path = serializer.validated_data.get(field_name, '')
process_path(file_path, imf)
except Exception as err:
file_path = extract_file_path(imf.name)
process_path(file_path, imf)
return files
fobi_integration_form_handlers.py¶
Register the plugin. Note the name pattern fobi_integration_form_handlers.
from fobi.base import integration_form_handler_plugin_registry
from .base import MailHandlerPlugin
integration_form_handler_plugin_registry.register(MailHandlerPlugin)
Don’t forget to list your plugin in the INSTALLED_APPS
afterwards.
Permissions¶
Plugin system allows administrators to specify the access rights to every plugin. django-fobi permissions are based on Django Users and User Groups. Access rights are manageable via Django admin (“/admin/fobi/formelement/”, “/admin/fobi/formhandler/”). If user doesn’t have the rights to access plugin, it doesn’t appear on his form even if has been added to it (imagine, you have once granted the right to use the news plugin to all users, but later on decided to limit it to Staff members group only). Note, that superusers have access to all plugins.
Plugin access rights management interface in Django admin
┌──────────────────────────┬───────────────────────┬───────────────────────┐
│ `Plugin` │ `Users` │ `Groups` │
├──────────────────────────┼───────────────────────┼───────────────────────┤
│ Text │ John Doe │ Form builder users │
├──────────────────────────┼───────────────────────┼───────────────────────┤
│ Textarea │ │ Form builder users │
├──────────────────────────┼───────────────────────┼───────────────────────┤
│ File │ Oscar, John Doe │ Staff members │
├──────────────────────────┼───────────────────────┼───────────────────────┤
│ URL │ │ Form builder users │
├──────────────────────────┼───────────────────────┼───────────────────────┤
│ Hidden │ │ Form builder users │
└──────────────────────────┴───────────────────────┴───────────────────────┘
Management commands¶
There are several management commands available.
- fobi_find_broken_entries. Find broken form element/handler entries that occur when some plugin which did exist in the system, no longer exists.
- fobi_sync_plugins. Should be ran each time a new plugin is being added to the django-fobi.
- fobi_update_plugin_data. A mechanism to update existing plugin data in
case if it had become invalid after a change in a plugin. In order for it
to work, each plugin should implement and
update
method, in which the data update happens.
Tuning¶
There are number of django-fobi settings you can override in the settings module of your Django project:
- FOBI_RESTRICT_PLUGIN_ACCESS (bool): If set to True, (Django) permission system for dash plugins is enabled. Defaults to True. Setting this to False makes all plugins available for all users.
- FOBI_DEFAULT_THEME (str): Active (default) theme UID. Defaults to “bootstrap3”.
- FORM_HANDLER_PLUGINS_EXECUTION_ORDER (list of tuples): Order in which the form handlers are executed. See the “Prioritise the execution order” section for details.
For tuning of specific contrib plugin, see the docs in the plugin directory.
Bundled plugins and themes¶
django-fobi ships with number of bundled form element- and form handler- plugins, as well as themes which are ready to be used as is.
Bundled form element plugins¶
Below a short overview of the form element plugins. See the README.rst file in directory of each plugin for details.
Fields¶
Fields marked with asterisk (*) fall under the definition of text elements. It’s possible to provide Dynamic initial values for text elements.
- Boolean (checkbox)
- Date
- DateTime
- Date drop down (year, month, day selection drop-downs)
- Decimal
- Duration
- Email*
- File
- Float
- Hidden*
- Input
- IP address*
- Integer
- Null boolean
- Password*
- Radio select (radio button)
- Range select
- Select (drop-down)
- Select model object (drop-down)
- Select multiple (drop-down)
- Select multiple model objects (drop-down)
- Slider
- Slug*
- Text*
- Textarea*
- Time
- URL*
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 text: Add text.
- Content richtext: Add rich text (based on django-ckeditor package).
- Content markdown: Add markdown 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
- 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/79.0.3945.36/chromedriver_linux64.zip unzip chromedriver_linux64.zip sudo mv chromedriver /usr/bin/chromedriver79 sudo chown root:root /usr/bin/chromedriver79 sudo chmod +x /usr/bin/chromedriver79
Specify the full path to your ChromeDriver in
CHROME_DRIVER_EXECUTABLE_PATH
setting. Example:CHROME_DRIVER_EXECUTABLE_PATH = '/usr/bin/chromedriver79'
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
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 |
Documentation¶
Contents:
- django-fobi
- Prerequisites
- Key concepts
- Main features and highlights
- Roadmap
- Some screenshots
- Demo
- Quick start
- Installation
- Creating a new form element plugin
- Creating a new form handler plugin
- Creating a new form importer plugin
- Creating a form callback
- Suggestions
- Theming
- Form wizards
- Integration with third-party apps and frameworks
- Permissions
- Management commands
- Tuning
- Bundled plugins and themes
- Third-party plugins and themes
- HTML5 fields
- Loading initial data using GET arguments
- Dynamic initial values
- Submitted form element plugins values
- Rendering forms using third-party libraries
- Import/export forms
- Translations
- Debugging
- Testing
- Writing documentation
- Troubleshooting
- Contributing
- License
- Support
- Author
- Screenshots
- Documentation
- Quick start
- Release history and notes
- 0.16.2
- 0.16.1
- 0.16
- 0.15
- 0.14
- 0.13.10
- 0.13.9
- 0.13.8
- 0.13.7
- 0.13.6
- 0.13.5
- 0.13.4
- 0.13.3
- 0.13.2
- 0.13.1
- 0.13
- 0.12.20
- 0.12.19
- 0.12.18
- 0.12.17
- 0.12.16
- 0.12.15
- 0.12.14
- 0.12.13
- 0.12.12
- 0.12.11
- 0.12.10
- 0.12.9
- 0.12.8
- 0.12.7
- 0.12.6
- 0.12.5
- 0.12.4
- 0.12.3
- 0.12.2
- 0.12.1
- 0.12
- 0.11.13
- 0.11.12
- 0.11.11
- 0.11.10
- 0.11.9
- 0.11.8
- 0.11.7
- 0.11.6
- 0.11.5
- 0.11.4
- 0.11.3
- 0.11.2
- 0.11.1
- 0.11
- 0.10.7
- 0.10.6
- 0.10.5
- 0.10.4
- 0.10.3
- 0.10.2
- 0.10.1
- 0.10
- 0.9.17
- 0.9.16
- 0.9.15
- 0.9.14
- 0.9.13
- 0.9.12
- 0.9.11
- 0.9.10
- 0.9.9
- 0.9.8
- 0.9.7
- 0.9.6
- 0.9.5
- 0.9.4
- 0.9.3
- 0.9.2
- 0.9.1
- 0.9
- 0.8.10
- 0.8.9
- 0.8.8
- 0.8.7
- 0.8.6
- 0.8.5
- 0.8.4
- 0.8.3
- 0.8.2
- 0.8.1
- 0.8
- 0.7.1
- 0.7
- 0.6.10
- 0.6.9
- 0.6.8
- 0.6.7
- 0.6.6
- 0.6.5
- 0.6.4
- 0.6.3
- 0.6.2
- 0.6.1
- 0.6
- 0.5.19
- 0.5.18
- 0.5.17
- 0.5.16
- 0.5.15
- 0.5.14
- 0.5.13
- 0.5.12
- 0.5.11
- 0.5.10
- 0.5.9
- 0.5.8
- 0.5.7
- 0.5.6
- 0.5.5
- 0.5.4
- 0.5.3
- 0.5.2
- 0.5.1
- 0.5
- 0.4.36
- 0.4.35
- 0.4.34
- 0.4.33
- 0.4.32
- 0.4.31
- 0.4.30
- 0.4.29
- 0.4.28
- 0.4.27
- 0.4.26
- 0.4.25
- 0.4.24
- 0.4.23
- 0.4.22
- 0.4.21
- 0.4.20
- 0.4.19
- 0.4.18
- 0.4.17
- 0.4.16
- 0.4.15
- 0.4.14
- 0.4.13
- 0.4.12
- 0.4.11
- 0.4.10
- 0.4.9
- 0.4.8
- 0.4.7
- 0.4.6
- 0.4.5
- 0.4.4
- 0.4.3
- 0.4.2
- 0.4.1
- 0.4
- 0.3.4
- 0.3.3
- 0.3.2
- 0.3.1
- 0.3
- 0.2.1
- 0.2
- 0.1.6
- 0.1.5
- 0.1.4
- 0.1.3
- 0.1.2
- 0.1.1
- 0.1
- Licenses
- Bootstrap3
- Bootstrap 3 DateTime picker
- bootstrap-slider
- django-autoslug
- django-formtools
- django-nine
- django-nonefield
- easy-thumbnails
- Font-awesome
- Foundation 5
- Foundation 5 DateTime picker
- jQuery Colorbox
- jQuery
- jQueryUI
- jQuery-Slugify-Plugin
- moment.js
- ordereddict
- Pillow
- Requests
- Six
- Unidecode
- vishap
- fobi package
- Subpackages
- fobi.contrib package
- Subpackages
- fobi.contrib.apps package
- Subpackages
- fobi.contrib.apps.djangocms_integration package
- Submodules
- fobi.contrib.apps.djangocms_integration.apps module
- fobi.contrib.apps.djangocms_integration.cms_plugins module
- fobi.contrib.apps.djangocms_integration.cms_version module
- fobi.contrib.apps.djangocms_integration.conf module
- fobi.contrib.apps.djangocms_integration.defaults module
- fobi.contrib.apps.djangocms_integration.helpers module
- fobi.contrib.apps.djangocms_integration.models module
- fobi.contrib.apps.djangocms_integration.settings module
- Module contents
- fobi.contrib.apps.drf_integration package
- Subpackages
- fobi.contrib.apps.drf_integration.form_elements package
- Subpackages
- fobi.contrib.apps.drf_integration.form_elements.content package
- Subpackages
- fobi.contrib.apps.drf_integration.form_elements.content.content_image package
- fobi.contrib.apps.drf_integration.form_elements.content.content_image_url package
- Submodules
- fobi.contrib.apps.drf_integration.form_elements.content.content_image_url.apps module
- fobi.contrib.apps.drf_integration.form_elements.content.content_image_url.base module
- fobi.contrib.apps.drf_integration.form_elements.content.content_image_url.fobi_integration_form_elements module
- Module contents
- fobi.contrib.apps.drf_integration.form_elements.content.content_markdown package
- Submodules
- fobi.contrib.apps.drf_integration.form_elements.content.content_markdown.apps module
- fobi.contrib.apps.drf_integration.form_elements.content.content_markdown.base module
- fobi.contrib.apps.drf_integration.form_elements.content.content_markdown.fobi_integration_form_elements module
- Module contents
- fobi.contrib.apps.drf_integration.form_elements.content.content_richtext package
- Submodules
- fobi.contrib.apps.drf_integration.form_elements.content.content_richtext.apps module
- fobi.contrib.apps.drf_integration.form_elements.content.content_richtext.base module
- fobi.contrib.apps.drf_integration.form_elements.content.content_richtext.fobi_integration_form_elements module
- Module contents
- fobi.contrib.apps.drf_integration.form_elements.content.content_text package
- fobi.contrib.apps.drf_integration.form_elements.content.content_video package
- Module contents
- Subpackages
- fobi.contrib.apps.drf_integration.form_elements.fields package
- Subpackages
- fobi.contrib.apps.drf_integration.form_elements.fields.boolean package
- fobi.contrib.apps.drf_integration.form_elements.fields.checkbox_select_multiple package
- Submodules
- fobi.contrib.apps.drf_integration.form_elements.fields.checkbox_select_multiple.apps module
- fobi.contrib.apps.drf_integration.form_elements.fields.checkbox_select_multiple.base module
- fobi.contrib.apps.drf_integration.form_elements.fields.checkbox_select_multiple.fobi_integration_form_elements module
- Module contents
- fobi.contrib.apps.drf_integration.form_elements.fields.date package
- fobi.contrib.apps.drf_integration.form_elements.fields.date_drop_down package
- fobi.contrib.apps.drf_integration.form_elements.fields.datetime package
- fobi.contrib.apps.drf_integration.form_elements.fields.decimal package
- fobi.contrib.apps.drf_integration.form_elements.fields.duration package
- fobi.contrib.apps.drf_integration.form_elements.fields.email package
- fobi.contrib.apps.drf_integration.form_elements.fields.file package
- fobi.contrib.apps.drf_integration.form_elements.fields.float package
- fobi.contrib.apps.drf_integration.form_elements.fields.hidden package
- fobi.contrib.apps.drf_integration.form_elements.fields.input package
- fobi.contrib.apps.drf_integration.form_elements.fields.integer package
- fobi.contrib.apps.drf_integration.form_elements.fields.ip_address package
- fobi.contrib.apps.drf_integration.form_elements.fields.null_boolean package
- fobi.contrib.apps.drf_integration.form_elements.fields.password package
- fobi.contrib.apps.drf_integration.form_elements.fields.radio package
- fobi.contrib.apps.drf_integration.form_elements.fields.range_select package
- fobi.contrib.apps.drf_integration.form_elements.fields.regex package
- fobi.contrib.apps.drf_integration.form_elements.fields.select package
- fobi.contrib.apps.drf_integration.form_elements.fields.select_model_object package
- Submodules
- fobi.contrib.apps.drf_integration.form_elements.fields.select_model_object.apps module
- fobi.contrib.apps.drf_integration.form_elements.fields.select_model_object.base module
- fobi.contrib.apps.drf_integration.form_elements.fields.select_model_object.fobi_integration_form_elements module
- Module contents
- fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple package
- Submodules
- fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple.apps module
- fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple.base module
- fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple.fobi_integration_form_elements module
- Module contents
- fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple_model_objects package
- Submodules
- fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple_model_objects.apps module
- fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple_model_objects.base module
- fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple_model_objects.fobi_integration_form_elements module
- Module contents
- fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple_with_max package
- Submodules
- fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple_with_max.apps module
- fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple_with_max.base module
- fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple_with_max.fobi_integration_form_elements module
- Module contents
- fobi.contrib.apps.drf_integration.form_elements.fields.slider package
- fobi.contrib.apps.drf_integration.form_elements.fields.slug package
- fobi.contrib.apps.drf_integration.form_elements.fields.text package
- fobi.contrib.apps.drf_integration.form_elements.fields.textarea package
- fobi.contrib.apps.drf_integration.form_elements.fields.time package
- fobi.contrib.apps.drf_integration.form_elements.fields.url package
- Module contents
- Subpackages
- fobi.contrib.apps.drf_integration.form_elements.content package
- Module contents
- Subpackages
- fobi.contrib.apps.drf_integration.form_handlers package
- fobi.contrib.apps.drf_integration.form_elements package
- Submodules
- fobi.contrib.apps.drf_integration.apps module
- fobi.contrib.apps.drf_integration.base module
- fobi.contrib.apps.drf_integration.dynamic module
- fobi.contrib.apps.drf_integration.fields module
- fobi.contrib.apps.drf_integration.helpers module
- fobi.contrib.apps.drf_integration.metadata module
- fobi.contrib.apps.drf_integration.serializers module
- fobi.contrib.apps.drf_integration.urls module
- fobi.contrib.apps.drf_integration.utils module
- fobi.contrib.apps.drf_integration.views module
- Module contents
- Subpackages
- fobi.contrib.apps.feincms_integration package
- Submodules
- fobi.contrib.apps.feincms_integration.apps module
- fobi.contrib.apps.feincms_integration.conf module
- fobi.contrib.apps.feincms_integration.defaults module
- fobi.contrib.apps.feincms_integration.helpers module
- fobi.contrib.apps.feincms_integration.settings module
- fobi.contrib.apps.feincms_integration.widgets module
- Module contents
- fobi.contrib.apps.mezzanine_integration package
- Submodules
- fobi.contrib.apps.mezzanine_integration.admin module
- fobi.contrib.apps.mezzanine_integration.apps module
- fobi.contrib.apps.mezzanine_integration.conf module
- fobi.contrib.apps.mezzanine_integration.defaults module
- fobi.contrib.apps.mezzanine_integration.helpers module
- fobi.contrib.apps.mezzanine_integration.models module
- fobi.contrib.apps.mezzanine_integration.page_processors module
- fobi.contrib.apps.mezzanine_integration.settings module
- Module contents
- fobi.contrib.apps.djangocms_integration package
- Module contents
- Subpackages
- fobi.contrib.plugins package
- Subpackages
- fobi.contrib.plugins.form_elements package
- Subpackages
- fobi.contrib.plugins.form_elements.content package
- Subpackages
- fobi.contrib.plugins.form_elements.content.content_image package
- Submodules
- fobi.contrib.plugins.form_elements.content.content_image.apps module
- fobi.contrib.plugins.form_elements.content.content_image.base module
- fobi.contrib.plugins.form_elements.content.content_image.conf module
- fobi.contrib.plugins.form_elements.content.content_image.defaults module
- fobi.contrib.plugins.form_elements.content.content_image.fobi_form_elements module
- fobi.contrib.plugins.form_elements.content.content_image.forms module
- fobi.contrib.plugins.form_elements.content.content_image.helpers module
- fobi.contrib.plugins.form_elements.content.content_image.settings module
- Module contents
- fobi.contrib.plugins.form_elements.content.content_image_url package
- Submodules
- fobi.contrib.plugins.form_elements.content.content_image_url.apps module
- fobi.contrib.plugins.form_elements.content.content_image_url.base module
- fobi.contrib.plugins.form_elements.content.content_image_url.conf module
- fobi.contrib.plugins.form_elements.content.content_image_url.defaults module
- fobi.contrib.plugins.form_elements.content.content_image_url.fobi_form_elements module
- fobi.contrib.plugins.form_elements.content.content_image_url.forms module
- fobi.contrib.plugins.form_elements.content.content_image_url.settings module
- Module contents
- fobi.contrib.plugins.form_elements.content.content_markdown package
- Submodules
- fobi.contrib.plugins.form_elements.content.content_markdown.apps module
- fobi.contrib.plugins.form_elements.content.content_markdown.base module
- fobi.contrib.plugins.form_elements.content.content_markdown.fobi_form_elements module
- fobi.contrib.plugins.form_elements.content.content_markdown.forms module
- fobi.contrib.plugins.form_elements.content.content_markdown.widgets module
- Module contents
- fobi.contrib.plugins.form_elements.content.content_richtext package
- Submodules
- fobi.contrib.plugins.form_elements.content.content_richtext.apps module
- fobi.contrib.plugins.form_elements.content.content_richtext.base module
- fobi.contrib.plugins.form_elements.content.content_richtext.fobi_form_elements module
- fobi.contrib.plugins.form_elements.content.content_richtext.forms module
- fobi.contrib.plugins.form_elements.content.content_richtext.widgets module
- Module contents
- fobi.contrib.plugins.form_elements.content.content_text package
- Submodules
- fobi.contrib.plugins.form_elements.content.content_text.apps module
- fobi.contrib.plugins.form_elements.content.content_text.base module
- fobi.contrib.plugins.form_elements.content.content_text.conf module
- fobi.contrib.plugins.form_elements.content.content_text.defaults module
- fobi.contrib.plugins.form_elements.content.content_text.fobi_form_elements module
- fobi.contrib.plugins.form_elements.content.content_text.forms module
- fobi.contrib.plugins.form_elements.content.content_text.settings module
- Module contents
- fobi.contrib.plugins.form_elements.content.content_video package
- Submodules
- fobi.contrib.plugins.form_elements.content.content_video.apps module
- fobi.contrib.plugins.form_elements.content.content_video.base module
- fobi.contrib.plugins.form_elements.content.content_video.conf module
- fobi.contrib.plugins.form_elements.content.content_video.defaults module
- fobi.contrib.plugins.form_elements.content.content_video.fobi_form_elements module
- fobi.contrib.plugins.form_elements.content.content_video.forms module
- fobi.contrib.plugins.form_elements.content.content_video.settings module
- Module contents
- fobi.contrib.plugins.form_elements.content.content_image package
- Module contents
- Subpackages
- fobi.contrib.plugins.form_elements.fields package
- Subpackages
- fobi.contrib.plugins.form_elements.fields.boolean package
- fobi.contrib.plugins.form_elements.fields.checkbox_select_multiple package
- Submodules
- fobi.contrib.plugins.form_elements.fields.checkbox_select_multiple.apps module
- fobi.contrib.plugins.form_elements.fields.checkbox_select_multiple.base module
- fobi.contrib.plugins.form_elements.fields.checkbox_select_multiple.conf module
- fobi.contrib.plugins.form_elements.fields.checkbox_select_multiple.defaults module
- fobi.contrib.plugins.form_elements.fields.checkbox_select_multiple.fobi_form_elements module
- fobi.contrib.plugins.form_elements.fields.checkbox_select_multiple.forms module
- fobi.contrib.plugins.form_elements.fields.checkbox_select_multiple.settings module
- Module contents
- fobi.contrib.plugins.form_elements.fields.date package
- Submodules
- fobi.contrib.plugins.form_elements.fields.date.apps module
- fobi.contrib.plugins.form_elements.fields.date.base module
- fobi.contrib.plugins.form_elements.fields.date.fobi_form_elements module
- fobi.contrib.plugins.form_elements.fields.date.forms module
- fobi.contrib.plugins.form_elements.fields.date.widgets module
- Module contents
- fobi.contrib.plugins.form_elements.fields.date_drop_down package
- Submodules
- fobi.contrib.plugins.form_elements.fields.date_drop_down.apps module
- fobi.contrib.plugins.form_elements.fields.date_drop_down.base module
- fobi.contrib.plugins.form_elements.fields.date_drop_down.fobi_form_elements module
- fobi.contrib.plugins.form_elements.fields.date_drop_down.forms module
- Module contents
- fobi.contrib.plugins.form_elements.fields.datetime package
- Submodules
- fobi.contrib.plugins.form_elements.fields.datetime.apps module
- fobi.contrib.plugins.form_elements.fields.datetime.base module
- fobi.contrib.plugins.form_elements.fields.datetime.fobi_form_elements module
- fobi.contrib.plugins.form_elements.fields.datetime.forms module
- fobi.contrib.plugins.form_elements.fields.datetime.widgets module
- Module contents
- fobi.contrib.plugins.form_elements.fields.decimal package
- fobi.contrib.plugins.form_elements.fields.duration package
- fobi.contrib.plugins.form_elements.fields.email package
- fobi.contrib.plugins.form_elements.fields.file package
- Submodules
- fobi.contrib.plugins.form_elements.fields.file.apps module
- fobi.contrib.plugins.form_elements.fields.file.base module
- fobi.contrib.plugins.form_elements.fields.file.conf module
- fobi.contrib.plugins.form_elements.fields.file.defaults module
- fobi.contrib.plugins.form_elements.fields.file.fobi_form_elements module
- fobi.contrib.plugins.form_elements.fields.file.forms module
- fobi.contrib.plugins.form_elements.fields.file.settings module
- Module contents
- fobi.contrib.plugins.form_elements.fields.float package
- fobi.contrib.plugins.form_elements.fields.hidden package
- fobi.contrib.plugins.form_elements.fields.input package
- Submodules
- fobi.contrib.plugins.form_elements.fields.input.apps module
- fobi.contrib.plugins.form_elements.fields.input.base module
- fobi.contrib.plugins.form_elements.fields.input.constants module
- fobi.contrib.plugins.form_elements.fields.input.fobi_form_elements module
- fobi.contrib.plugins.form_elements.fields.input.forms module
- Module contents
- fobi.contrib.plugins.form_elements.fields.integer package
- fobi.contrib.plugins.form_elements.fields.ip_address package
- Submodules
- fobi.contrib.plugins.form_elements.fields.ip_address.apps module
- fobi.contrib.plugins.form_elements.fields.ip_address.base module
- fobi.contrib.plugins.form_elements.fields.ip_address.fobi_form_elements module
- fobi.contrib.plugins.form_elements.fields.ip_address.forms module
- Module contents
- fobi.contrib.plugins.form_elements.fields.null_boolean package
- Submodules
- fobi.contrib.plugins.form_elements.fields.null_boolean.apps module
- fobi.contrib.plugins.form_elements.fields.null_boolean.base module
- fobi.contrib.plugins.form_elements.fields.null_boolean.fobi_form_elements module
- fobi.contrib.plugins.form_elements.fields.null_boolean.forms module
- Module contents
- fobi.contrib.plugins.form_elements.fields.password package
- fobi.contrib.plugins.form_elements.fields.radio package
- Submodules
- fobi.contrib.plugins.form_elements.fields.radio.apps module
- fobi.contrib.plugins.form_elements.fields.radio.base module
- fobi.contrib.plugins.form_elements.fields.radio.conf module
- fobi.contrib.plugins.form_elements.fields.radio.defaults module
- fobi.contrib.plugins.form_elements.fields.radio.fobi_form_elements module
- fobi.contrib.plugins.form_elements.fields.radio.forms module
- fobi.contrib.plugins.form_elements.fields.radio.settings module
- Module contents
- fobi.contrib.plugins.form_elements.fields.range_select package
- Submodules
- fobi.contrib.plugins.form_elements.fields.range_select.apps module
- fobi.contrib.plugins.form_elements.fields.range_select.base module
- fobi.contrib.plugins.form_elements.fields.range_select.conf module
- fobi.contrib.plugins.form_elements.fields.range_select.defaults module
- fobi.contrib.plugins.form_elements.fields.range_select.fobi_form_elements module
- fobi.contrib.plugins.form_elements.fields.range_select.forms module
- fobi.contrib.plugins.form_elements.fields.range_select.settings module
- Module contents
- fobi.contrib.plugins.form_elements.fields.regex package
- fobi.contrib.plugins.form_elements.fields.select package
- Submodules
- fobi.contrib.plugins.form_elements.fields.select.apps module
- fobi.contrib.plugins.form_elements.fields.select.base module
- fobi.contrib.plugins.form_elements.fields.select.conf module
- fobi.contrib.plugins.form_elements.fields.select.defaults module
- fobi.contrib.plugins.form_elements.fields.select.fobi_form_elements module
- fobi.contrib.plugins.form_elements.fields.select.forms module
- fobi.contrib.plugins.form_elements.fields.select.settings module
- Module contents
- fobi.contrib.plugins.form_elements.fields.select_model_object package
- Submodules
- fobi.contrib.plugins.form_elements.fields.select_model_object.apps module
- fobi.contrib.plugins.form_elements.fields.select_model_object.base module
- fobi.contrib.plugins.form_elements.fields.select_model_object.conf module
- fobi.contrib.plugins.form_elements.fields.select_model_object.defaults module
- fobi.contrib.plugins.form_elements.fields.select_model_object.fobi_form_elements module
- fobi.contrib.plugins.form_elements.fields.select_model_object.forms module
- fobi.contrib.plugins.form_elements.fields.select_model_object.settings module
- Module contents
- fobi.contrib.plugins.form_elements.fields.select_mptt_model_object package
- Submodules
- fobi.contrib.plugins.form_elements.fields.select_mptt_model_object.apps module
- fobi.contrib.plugins.form_elements.fields.select_mptt_model_object.base module
- fobi.contrib.plugins.form_elements.fields.select_mptt_model_object.conf module
- fobi.contrib.plugins.form_elements.fields.select_mptt_model_object.defaults module
- fobi.contrib.plugins.form_elements.fields.select_mptt_model_object.fobi_form_elements module
- fobi.contrib.plugins.form_elements.fields.select_mptt_model_object.forms module
- fobi.contrib.plugins.form_elements.fields.select_mptt_model_object.settings module
- Module contents
- fobi.contrib.plugins.form_elements.fields.select_multiple package
- Submodules
- fobi.contrib.plugins.form_elements.fields.select_multiple.apps module
- fobi.contrib.plugins.form_elements.fields.select_multiple.base module
- fobi.contrib.plugins.form_elements.fields.select_multiple.conf module
- fobi.contrib.plugins.form_elements.fields.select_multiple.defaults module
- fobi.contrib.plugins.form_elements.fields.select_multiple.fobi_form_elements module
- fobi.contrib.plugins.form_elements.fields.select_multiple.forms module
- fobi.contrib.plugins.form_elements.fields.select_multiple.settings module
- Module contents
- fobi.contrib.plugins.form_elements.fields.select_multiple_model_objects package
- Submodules
- fobi.contrib.plugins.form_elements.fields.select_multiple_model_objects.apps module
- fobi.contrib.plugins.form_elements.fields.select_multiple_model_objects.base module
- fobi.contrib.plugins.form_elements.fields.select_multiple_model_objects.conf module
- fobi.contrib.plugins.form_elements.fields.select_multiple_model_objects.defaults module
- fobi.contrib.plugins.form_elements.fields.select_multiple_model_objects.fobi_form_elements module
- fobi.contrib.plugins.form_elements.fields.select_multiple_model_objects.forms module
- fobi.contrib.plugins.form_elements.fields.select_multiple_model_objects.settings module
- Module contents
- fobi.contrib.plugins.form_elements.fields.select_multiple_mptt_model_objects package
- Submodules
- fobi.contrib.plugins.form_elements.fields.select_multiple_mptt_model_objects.apps module
- fobi.contrib.plugins.form_elements.fields.select_multiple_mptt_model_objects.base module
- fobi.contrib.plugins.form_elements.fields.select_multiple_mptt_model_objects.conf module
- fobi.contrib.plugins.form_elements.fields.select_multiple_mptt_model_objects.defaults module
- fobi.contrib.plugins.form_elements.fields.select_multiple_mptt_model_objects.fobi_form_elements module
- fobi.contrib.plugins.form_elements.fields.select_multiple_mptt_model_objects.forms module
- fobi.contrib.plugins.form_elements.fields.select_multiple_mptt_model_objects.settings module
- Module contents
- fobi.contrib.plugins.form_elements.fields.select_multiple_with_max package
- Submodules
- fobi.contrib.plugins.form_elements.fields.select_multiple_with_max.apps module
- fobi.contrib.plugins.form_elements.fields.select_multiple_with_max.base module
- fobi.contrib.plugins.form_elements.fields.select_multiple_with_max.conf module
- fobi.contrib.plugins.form_elements.fields.select_multiple_with_max.defaults module
- fobi.contrib.plugins.form_elements.fields.select_multiple_with_max.fields module
- fobi.contrib.plugins.form_elements.fields.select_multiple_with_max.fobi_form_elements module
- fobi.contrib.plugins.form_elements.fields.select_multiple_with_max.forms module
- fobi.contrib.plugins.form_elements.fields.select_multiple_with_max.settings module
- Module contents
- fobi.contrib.plugins.form_elements.fields.slider package
- Submodules
- fobi.contrib.plugins.form_elements.fields.slider.apps module
- fobi.contrib.plugins.form_elements.fields.slider.base module
- fobi.contrib.plugins.form_elements.fields.slider.conf module
- fobi.contrib.plugins.form_elements.fields.slider.constants module
- fobi.contrib.plugins.form_elements.fields.slider.defaults module
- fobi.contrib.plugins.form_elements.fields.slider.fobi_form_elements module
- fobi.contrib.plugins.form_elements.fields.slider.forms module
- fobi.contrib.plugins.form_elements.fields.slider.helpers module
- fobi.contrib.plugins.form_elements.fields.slider.settings module
- fobi.contrib.plugins.form_elements.fields.slider.widgets module
- Module contents
- fobi.contrib.plugins.form_elements.fields.slug package
- fobi.contrib.plugins.form_elements.fields.text package
- fobi.contrib.plugins.form_elements.fields.textarea package
- fobi.contrib.plugins.form_elements.fields.time package
- fobi.contrib.plugins.form_elements.fields.url package
- Module contents
- Subpackages
- fobi.contrib.plugins.form_elements.security package
- Subpackages
- fobi.contrib.plugins.form_elements.security.captcha package
- fobi.contrib.plugins.form_elements.security.honeypot package
- Submodules
- fobi.contrib.plugins.form_elements.security.honeypot.apps module
- fobi.contrib.plugins.form_elements.security.honeypot.base module
- fobi.contrib.plugins.form_elements.security.honeypot.conf module
- fobi.contrib.plugins.form_elements.security.honeypot.defaults module
- fobi.contrib.plugins.form_elements.security.honeypot.fields module
- fobi.contrib.plugins.form_elements.security.honeypot.fobi_form_elements module
- fobi.contrib.plugins.form_elements.security.honeypot.forms module
- fobi.contrib.plugins.form_elements.security.honeypot.settings module
- Module contents
- fobi.contrib.plugins.form_elements.security.recaptcha package
- Submodules
- fobi.contrib.plugins.form_elements.security.recaptcha.apps module
- fobi.contrib.plugins.form_elements.security.recaptcha.base module
- fobi.contrib.plugins.form_elements.security.recaptcha.fobi_form_elements module
- fobi.contrib.plugins.form_elements.security.recaptcha.forms module
- Module contents
- Module contents
- Subpackages
- fobi.contrib.plugins.form_elements.test package
- fobi.contrib.plugins.form_elements.content package
- Module contents
- Subpackages
- fobi.contrib.plugins.form_handlers package
- Subpackages
- fobi.contrib.plugins.form_handlers.db_store package
- Subpackages
- Submodules
- fobi.contrib.plugins.form_handlers.db_store.admin module
- fobi.contrib.plugins.form_handlers.db_store.apps module
- fobi.contrib.plugins.form_handlers.db_store.base module
- fobi.contrib.plugins.form_handlers.db_store.callbacks module
- fobi.contrib.plugins.form_handlers.db_store.conf module
- fobi.contrib.plugins.form_handlers.db_store.defaults module
- fobi.contrib.plugins.form_handlers.db_store.fobi_form_handlers module
- fobi.contrib.plugins.form_handlers.db_store.helpers module
- fobi.contrib.plugins.form_handlers.db_store.models module
- fobi.contrib.plugins.form_handlers.db_store.settings module
- fobi.contrib.plugins.form_handlers.db_store.views module
- fobi.contrib.plugins.form_handlers.db_store.widgets module
- Module contents
- fobi.contrib.plugins.form_handlers.http_repost package
- fobi.contrib.plugins.form_handlers.mail package
- Submodules
- fobi.contrib.plugins.form_handlers.mail.apps module
- fobi.contrib.plugins.form_handlers.mail.base module
- fobi.contrib.plugins.form_handlers.mail.callbacks module
- fobi.contrib.plugins.form_handlers.mail.conf module
- fobi.contrib.plugins.form_handlers.mail.defaults module
- fobi.contrib.plugins.form_handlers.mail.fields module
- fobi.contrib.plugins.form_handlers.mail.fobi_form_handlers module
- fobi.contrib.plugins.form_handlers.mail.forms module
- fobi.contrib.plugins.form_handlers.mail.helpers module
- fobi.contrib.plugins.form_handlers.mail.mixins module
- fobi.contrib.plugins.form_handlers.mail.settings module
- fobi.contrib.plugins.form_handlers.mail.widgets module
- Module contents
- fobi.contrib.plugins.form_handlers.db_store package
- Module contents
- Subpackages
- fobi.contrib.plugins.form_importers package
- Subpackages
- fobi.contrib.plugins.form_importers.mailchimp_importer package
- Submodules
- fobi.contrib.plugins.form_importers.mailchimp_importer.apps module
- fobi.contrib.plugins.form_importers.mailchimp_importer.base module
- fobi.contrib.plugins.form_importers.mailchimp_importer.fobi_form_importers module
- fobi.contrib.plugins.form_importers.mailchimp_importer.forms module
- fobi.contrib.plugins.form_importers.mailchimp_importer.views module
- Module contents
- fobi.contrib.plugins.form_importers.mailchimp_importer package
- Module contents
- Subpackages
- fobi.contrib.plugins.form_elements package
- Module contents
- Subpackages
- fobi.contrib.themes package
- Subpackages
- fobi.contrib.themes.bootstrap3 package
- Subpackages
- fobi.contrib.themes.bootstrap3.widgets package
- Subpackages
- fobi.contrib.themes.bootstrap3.widgets.form_elements package
- Subpackages
- fobi.contrib.themes.bootstrap3.widgets.form_elements.content_markdown_bootstrap3_widget package
- fobi.contrib.themes.bootstrap3.widgets.form_elements.content_richtext_bootstrap3_widget package
- fobi.contrib.themes.bootstrap3.widgets.form_elements.date_bootstrap3_widget package
- fobi.contrib.themes.bootstrap3.widgets.form_elements.datetime_bootstrap3_widget package
- fobi.contrib.themes.bootstrap3.widgets.form_elements.dummy_bootstrap3_widget package
- fobi.contrib.themes.bootstrap3.widgets.form_elements.slider_bootstrap3_widget package
- Module contents
- Subpackages
- fobi.contrib.themes.bootstrap3.widgets.form_elements package
- Module contents
- Subpackages
- fobi.contrib.themes.bootstrap3.widgets package
- Submodules
- fobi.contrib.themes.bootstrap3.apps module
- fobi.contrib.themes.bootstrap3.fobi_themes module
- Module contents
- Subpackages
- fobi.contrib.themes.djangocms_admin_style_theme package
- Subpackages
- fobi.contrib.themes.djangocms_admin_style_theme.widgets package
- Subpackages
- fobi.contrib.themes.djangocms_admin_style_theme.widgets.form_elements package
- fobi.contrib.themes.djangocms_admin_style_theme.widgets.form_handlers package
- Module contents
- Subpackages
- fobi.contrib.themes.djangocms_admin_style_theme.widgets package
- Submodules
- fobi.contrib.themes.djangocms_admin_style_theme.apps module
- fobi.contrib.themes.djangocms_admin_style_theme.fobi_themes module
- Module contents
- Subpackages
- fobi.contrib.themes.foundation5 package
- Subpackages
- fobi.contrib.themes.foundation5.widgets package
- Subpackages
- fobi.contrib.themes.foundation5.widgets.form_elements package
- Subpackages
- fobi.contrib.themes.foundation5.widgets.form_elements.content_richtext_foundation5_widget package
- fobi.contrib.themes.foundation5.widgets.form_elements.date_foundation5_widget package
- fobi.contrib.themes.foundation5.widgets.form_elements.datetime_foundation5_widget package
- fobi.contrib.themes.foundation5.widgets.form_elements.dummy_foundation5_widget package
- Module contents
- Subpackages
- fobi.contrib.themes.foundation5.widgets.form_handlers package
- fobi.contrib.themes.foundation5.widgets.form_elements package
- Module contents
- Subpackages
- fobi.contrib.themes.foundation5.widgets package
- Submodules
- fobi.contrib.themes.foundation5.apps module
- fobi.contrib.themes.foundation5.fobi_themes module
- Module contents
- Subpackages
- fobi.contrib.themes.simple package
- Subpackages
- fobi.contrib.themes.simple.widgets package
- Submodules
- fobi.contrib.themes.simple.apps module
- fobi.contrib.themes.simple.fobi_themes module
- Module contents
- Subpackages
- fobi.contrib.themes.bootstrap3 package
- Module contents
- Subpackages
- fobi.contrib.apps package
- Module contents
- Subpackages
- fobi.integration package
- fobi.management package
- fobi.migrations package
- Submodules
- fobi.migrations.0001_initial module
- fobi.migrations.0002_auto_20150912_1744 module
- fobi.migrations.0003_auto_20160517_1005 module
- fobi.migrations.0004_auto_20160906_1513 module
- fobi.migrations.0005_auto_20160908_1457 module
- fobi.migrations.0006_auto_20160911_1549 module
- fobi.migrations.0007_auto_20160926_1652 module
- fobi.migrations.0008_formwizardhandlerentry module
- fobi.migrations.0009_formwizardentry_wizard_type module
- fobi.migrations.0010_formwizardhandler module
- fobi.migrations.0011_formentry_title module
- fobi.migrations.0012_auto_20161109_1550 module
- fobi.migrations.0013_formwizardentry_show_all_navigation_buttons module
- fobi.migrations.0014_auto_20170516_1413 module
- Module contents
- fobi.reusable package
- fobi.templatetags package
- fobi.tests package
- Submodules
- fobi.tests.base module
- fobi.tests.constants module
- fobi.tests.core module
- fobi.tests.data module
- fobi.tests.helpers module
- fobi.tests.test_browser_build_dynamic_forms module
- fobi.tests.test_core module
- fobi.tests.test_drf_integration module
- fobi.tests.test_dynamic_forms module
- fobi.tests.test_feincms_integration module
- fobi.tests.test_form_importers_mailchimp module
- fobi.tests.test_sortable_dict module
- Module contents
- fobi.urls package
- fobi.wizard package
- fobi.contrib package
- Submodules
- fobi.admin module
- fobi.app module
- fobi.apps module
- fobi.base module
- fobi.conf module
- fobi.constants module
- fobi.context_processors module
- fobi.data_structures module
- fobi.decorators module
- fobi.defaults module
- fobi.discover module
- fobi.dynamic module
- fobi.exceptions module
- fobi.form_importers module
- fobi.form_utils module
- fobi.forms module
- fobi.helpers module
- fobi.models module
- fobi.settings module
- fobi.test module
- fobi.utils module
- fobi.validators module
- fobi.views module
- fobi.widgets module
- Module contents
- Subpackages
- Indices and tables
- (Sub)modules
- fobi.contrib.apps.djangocms_integration
- fobi.contrib.apps.drf_integration
- Form elements
- Content form element
- 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
- 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.date_drop_down
- fobi.contrib.apps.drf_integration.form_elements.fields.datetime
- fobi.contrib.apps.drf_integration.form_elements.fields.decimal
- fobi.contrib.apps.drf_integration.form_elements.fields.email
- fobi.contrib.apps.drf_integration.form_elements.fields.file
- fobi.contrib.apps.drf_integration.form_elements.fields.float
- fobi.contrib.apps.drf_integration.form_elements.fields.hidden
- fobi.contrib.apps.drf_integration.form_elements.fields.input
- fobi.contrib.apps.drf_integration.form_elements.fields.integer
- fobi.contrib.apps.drf_integration.form_elements.fields.ip_address
- fobi.contrib.apps.drf_integration.form_elements.fields.null_boolean
- fobi.contrib.apps.drf_integration.form_elements.fields.password
- fobi.contrib.apps.drf_integration.form_elements.fields.radio
- fobi.contrib.apps.drf_integration.form_elements.fields.range_select
- fobi.contrib.apps.drf_integration.form_elements.fields.regex
- fobi.contrib.apps.drf_integration.form_elements.fields.select
- fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple
- fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple
- 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
- Content form element
- Form handlers
- fobi.contrib.apps.feincms_integration
- fobi.contrib.apps.mezzanine_integration
- 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_richtext
- fobi.contrib.plugins.form_elements.content.content_video
- fobi.contrib.plugins.form_elements.fields.boolean
- fobi.contrib.plugins.form_elements.fields.checkbox_select_multiple
- fobi.contrib.plugins.form_elements.fields.date
- fobi.contrib.plugins.form_elements.fields.date_drop_down
- fobi.contrib.plugins.form_elements.fields.datetime
- fobi.contrib.plugins.form_elements.fields.decimal
- fobi.contrib.plugins.form_elements.fields.email
- fobi.contrib.plugins.form_elements.fields.file
- fobi.contrib.plugins.form_elements.fields.float
- fobi.contrib.plugins.form_elements.fields.hidden
- fobi.contrib.plugins.form_elements.fields.input
- fobi.contrib.plugins.form_elements.fields.integer
- fobi.contrib.plugins.form_elements.fields.ip_address
- fobi.contrib.plugins.form_elements.fields.null_boolean
- fobi.contrib.plugins.form_elements.fields.password
- fobi.contrib.plugins.form_elements.fields.radio
- fobi.contrib.plugins.form_elements.fields.range_select
- fobi.contrib.plugins.form_elements.fields.regex
- fobi.contrib.plugins.form_elements.fields.select
- fobi.contrib.plugins.form_elements.fields.select_model_object
- fobi.contrib.plugins.form_elements.fields.select_mptt_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.select_multiple_mptt_model_objects
- fobi.contrib.plugins.form_elements.fields.select_multiple_with_max
- fobi.contrib.plugins.form_elements.fields.slider
- 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.security.captcha
- fobi.contrib.plugins.form_elements.security.honeypot
- fobi.contrib.plugins.form_elements.security.recaptcha
- fobi.contrib.plugins.form_elements.test.dummy
- fobi.contrib.plugins.form_handlers.db_store
- fobi.contrib.plugins.form_handlers.http_repost
- fobi.contrib.plugins.form_handlers.mail
- mailchimp_importer
- fobi.contrib.themes.bootstrap3
- fobi.contrib.themes.djangocms_admin_style_theme
- fobi.contrib.themes.foundation5
- fobi.contrib.themes.simple
- Quick start
- Release history and notes
- 0.16.2
- 0.16.1
- 0.16
- 0.15
- 0.14
- 0.13.10
- 0.13.9
- 0.13.8
- 0.13.7
- 0.13.6
- 0.13.5
- 0.13.4
- 0.13.3
- 0.13.2
- 0.13.1
- 0.13
- 0.12.20
- 0.12.19
- 0.12.18
- 0.12.17
- 0.12.16
- 0.12.15
- 0.12.14
- 0.12.13
- 0.12.12
- 0.12.11
- 0.12.10
- 0.12.9
- 0.12.8
- 0.12.7
- 0.12.6
- 0.12.5
- 0.12.4
- 0.12.3
- 0.12.2
- 0.12.1
- 0.12
- 0.11.13
- 0.11.12
- 0.11.11
- 0.11.10
- 0.11.9
- 0.11.8
- 0.11.7
- 0.11.6
- 0.11.5
- 0.11.4
- 0.11.3
- 0.11.2
- 0.11.1
- 0.11
- 0.10.7
- 0.10.6
- 0.10.5
- 0.10.4
- 0.10.3
- 0.10.2
- 0.10.1
- 0.10
- 0.9.17
- 0.9.16
- 0.9.15
- 0.9.14
- 0.9.13
- 0.9.12
- 0.9.11
- 0.9.10
- 0.9.9
- 0.9.8
- 0.9.7
- 0.9.6
- 0.9.5
- 0.9.4
- 0.9.3
- 0.9.2
- 0.9.1
- 0.9
- 0.8.10
- 0.8.9
- 0.8.8
- 0.8.7
- 0.8.6
- 0.8.5
- 0.8.4
- 0.8.3
- 0.8.2
- 0.8.1
- 0.8
- 0.7.1
- 0.7
- 0.6.10
- 0.6.9
- 0.6.8
- 0.6.7
- 0.6.6
- 0.6.5
- 0.6.4
- 0.6.3
- 0.6.2
- 0.6.1
- 0.6
- 0.5.19
- 0.5.18
- 0.5.17
- 0.5.16
- 0.5.15
- 0.5.14
- 0.5.13
- 0.5.12
- 0.5.11
- 0.5.10
- 0.5.9
- 0.5.8
- 0.5.7
- 0.5.6
- 0.5.5
- 0.5.4
- 0.5.3
- 0.5.2
- 0.5.1
- 0.5
- 0.4.36
- 0.4.35
- 0.4.34
- 0.4.33
- 0.4.32
- 0.4.31
- 0.4.30
- 0.4.29
- 0.4.28
- 0.4.27
- 0.4.26
- 0.4.25
- 0.4.24
- 0.4.23
- 0.4.22
- 0.4.21
- 0.4.20
- 0.4.19
- 0.4.18
- 0.4.17
- 0.4.16
- 0.4.15
- 0.4.14
- 0.4.13
- 0.4.12
- 0.4.11
- 0.4.10
- 0.4.9
- 0.4.8
- 0.4.7
- 0.4.6
- 0.4.5
- 0.4.4
- 0.4.3
- 0.4.2
- 0.4.1
- 0.4
- 0.3.4
- 0.3.3
- 0.3.2
- 0.3.1
- 0.3
- 0.2.1
- 0.2
- 0.1.6
- 0.1.5
- 0.1.4
- 0.1.3
- 0.1.2
- 0.1.1
- 0.1
- Licenses
- Bootstrap3
- Bootstrap 3 DateTime picker
- bootstrap-slider
- django-autoslug
- django-formtools
- django-nine
- django-nonefield
- easy-thumbnails
- Font-awesome
- Foundation 5
- Foundation 5 DateTime picker
- jQuery Colorbox
- jQuery
- jQueryUI
- jQuery-Slugify-Plugin
- moment.js
- ordereddict
- Pillow
- Requests
- Six
- Unidecode
- vishap
- fobi package
- Subpackages
- fobi.contrib package
- Subpackages
- fobi.contrib.apps package
- Subpackages
- fobi.contrib.apps.djangocms_integration package
- Submodules
- fobi.contrib.apps.djangocms_integration.apps module
- fobi.contrib.apps.djangocms_integration.cms_plugins module
- fobi.contrib.apps.djangocms_integration.cms_version module
- fobi.contrib.apps.djangocms_integration.conf module
- fobi.contrib.apps.djangocms_integration.defaults module
- fobi.contrib.apps.djangocms_integration.helpers module
- fobi.contrib.apps.djangocms_integration.models module
- fobi.contrib.apps.djangocms_integration.settings module
- Module contents
- fobi.contrib.apps.drf_integration package
- Subpackages
- fobi.contrib.apps.drf_integration.form_elements package
- Subpackages
- fobi.contrib.apps.drf_integration.form_elements.content package
- Subpackages
- fobi.contrib.apps.drf_integration.form_elements.content.content_image package
- fobi.contrib.apps.drf_integration.form_elements.content.content_image_url package
- Submodules
- fobi.contrib.apps.drf_integration.form_elements.content.content_image_url.apps module
- fobi.contrib.apps.drf_integration.form_elements.content.content_image_url.base module
- fobi.contrib.apps.drf_integration.form_elements.content.content_image_url.fobi_integration_form_elements module
- Module contents
- fobi.contrib.apps.drf_integration.form_elements.content.content_markdown package
- Submodules
- fobi.contrib.apps.drf_integration.form_elements.content.content_markdown.apps module
- fobi.contrib.apps.drf_integration.form_elements.content.content_markdown.base module
- fobi.contrib.apps.drf_integration.form_elements.content.content_markdown.fobi_integration_form_elements module
- Module contents
- fobi.contrib.apps.drf_integration.form_elements.content.content_richtext package
- Submodules
- fobi.contrib.apps.drf_integration.form_elements.content.content_richtext.apps module
- fobi.contrib.apps.drf_integration.form_elements.content.content_richtext.base module
- fobi.contrib.apps.drf_integration.form_elements.content.content_richtext.fobi_integration_form_elements module
- Module contents
- fobi.contrib.apps.drf_integration.form_elements.content.content_text package
- fobi.contrib.apps.drf_integration.form_elements.content.content_video package
- Module contents
- Subpackages
- fobi.contrib.apps.drf_integration.form_elements.fields package
- Subpackages
- fobi.contrib.apps.drf_integration.form_elements.fields.boolean package
- fobi.contrib.apps.drf_integration.form_elements.fields.checkbox_select_multiple package
- Submodules
- fobi.contrib.apps.drf_integration.form_elements.fields.checkbox_select_multiple.apps module
- fobi.contrib.apps.drf_integration.form_elements.fields.checkbox_select_multiple.base module
- fobi.contrib.apps.drf_integration.form_elements.fields.checkbox_select_multiple.fobi_integration_form_elements module
- Module contents
- fobi.contrib.apps.drf_integration.form_elements.fields.date package
- fobi.contrib.apps.drf_integration.form_elements.fields.date_drop_down package
- fobi.contrib.apps.drf_integration.form_elements.fields.datetime package
- fobi.contrib.apps.drf_integration.form_elements.fields.decimal package
- fobi.contrib.apps.drf_integration.form_elements.fields.duration package
- fobi.contrib.apps.drf_integration.form_elements.fields.email package
- fobi.contrib.apps.drf_integration.form_elements.fields.file package
- fobi.contrib.apps.drf_integration.form_elements.fields.float package
- fobi.contrib.apps.drf_integration.form_elements.fields.hidden package
- fobi.contrib.apps.drf_integration.form_elements.fields.input package
- fobi.contrib.apps.drf_integration.form_elements.fields.integer package
- fobi.contrib.apps.drf_integration.form_elements.fields.ip_address package
- fobi.contrib.apps.drf_integration.form_elements.fields.null_boolean package
- fobi.contrib.apps.drf_integration.form_elements.fields.password package
- fobi.contrib.apps.drf_integration.form_elements.fields.radio package
- fobi.contrib.apps.drf_integration.form_elements.fields.range_select package
- fobi.contrib.apps.drf_integration.form_elements.fields.regex package
- fobi.contrib.apps.drf_integration.form_elements.fields.select package
- fobi.contrib.apps.drf_integration.form_elements.fields.select_model_object package
- Submodules
- fobi.contrib.apps.drf_integration.form_elements.fields.select_model_object.apps module
- fobi.contrib.apps.drf_integration.form_elements.fields.select_model_object.base module
- fobi.contrib.apps.drf_integration.form_elements.fields.select_model_object.fobi_integration_form_elements module
- Module contents
- fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple package
- Submodules
- fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple.apps module
- fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple.base module
- fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple.fobi_integration_form_elements module
- Module contents
- fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple_model_objects package
- Submodules
- fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple_model_objects.apps module
- fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple_model_objects.base module
- fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple_model_objects.fobi_integration_form_elements module
- Module contents
- fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple_with_max package
- Submodules
- fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple_with_max.apps module
- fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple_with_max.base module
- fobi.contrib.apps.drf_integration.form_elements.fields.select_multiple_with_max.fobi_integration_form_elements module
- Module contents
- fobi.contrib.apps.drf_integration.form_elements.fields.slider package
- fobi.contrib.apps.drf_integration.form_elements.fields.slug package
- fobi.contrib.apps.drf_integration.form_elements.fields.text package
- fobi.contrib.apps.drf_integration.form_elements.fields.textarea package
- fobi.contrib.apps.drf_integration.form_elements.fields.time package
- fobi.contrib.apps.drf_integration.form_elements.fields.url package
- Module contents
- Subpackages
- fobi.contrib.apps.drf_integration.form_elements.content package
- Module contents
- Subpackages
- fobi.contrib.apps.drf_integration.form_handlers package
- fobi.contrib.apps.drf_integration.form_elements package
- Submodules
- fobi.contrib.apps.drf_integration.apps module
- fobi.contrib.apps.drf_integration.base module
- fobi.contrib.apps.drf_integration.dynamic module
- fobi.contrib.apps.drf_integration.fields module
- fobi.contrib.apps.drf_integration.helpers module
- fobi.contrib.apps.drf_integration.metadata module
- fobi.contrib.apps.drf_integration.serializers module
- fobi.contrib.apps.drf_integration.urls module
- fobi.contrib.apps.drf_integration.utils module
- fobi.contrib.apps.drf_integration.views module
- Module contents
- Subpackages
- fobi.contrib.apps.feincms_integration package
- Submodules
- fobi.contrib.apps.feincms_integration.apps module
- fobi.contrib.apps.feincms_integration.conf module
- fobi.contrib.apps.feincms_integration.defaults module
- fobi.contrib.apps.feincms_integration.helpers module
- fobi.contrib.apps.feincms_integration.settings module
- fobi.contrib.apps.feincms_integration.widgets module
- Module contents
- fobi.contrib.apps.mezzanine_integration package
- Submodules
- fobi.contrib.apps.mezzanine_integration.admin module
- fobi.contrib.apps.mezzanine_integration.apps module
- fobi.contrib.apps.mezzanine_integration.conf module
- fobi.contrib.apps.mezzanine_integration.defaults module
- fobi.contrib.apps.mezzanine_integration.helpers module
- fobi.contrib.apps.mezzanine_integration.models module
- fobi.contrib.apps.mezzanine_integration.page_processors module
- fobi.contrib.apps.mezzanine_integration.settings module
- Module contents
- fobi.contrib.apps.djangocms_integration package
- Module contents
- Subpackages
- fobi.contrib.plugins package
- Subpackages
- fobi.contrib.plugins.form_elements package
- Subpackages
- fobi.contrib.plugins.form_elements.content package
- Subpackages
- fobi.contrib.plugins.form_elements.content.content_image package
- Submodules
- fobi.contrib.plugins.form_elements.content.content_image.apps module
- fobi.contrib.plugins.form_elements.content.content_image.base module
- fobi.contrib.plugins.form_elements.content.content_image.conf module
- fobi.contrib.plugins.form_elements.content.content_image.defaults module
- fobi.contrib.plugins.form_elements.content.content_image.fobi_form_elements module
- fobi.contrib.plugins.form_elements.content.content_image.forms module
- fobi.contrib.plugins.form_elements.content.content_image.helpers module
- fobi.contrib.plugins.form_elements.content.content_image.settings module
- Module contents
- fobi.contrib.plugins.form_elements.content.content_image_url package
- Submodules
- fobi.contrib.plugins.form_elements.content.content_image_url.apps module
- fobi.contrib.plugins.form_elements.content.content_image_url.base module
- fobi.contrib.plugins.form_elements.content.content_image_url.conf module
- fobi.contrib.plugins.form_elements.content.content_image_url.defaults module
- fobi.contrib.plugins.form_elements.content.content_image_url.fobi_form_elements module
- fobi.contrib.plugins.form_elements.content.content_image_url.forms module
- fobi.contrib.plugins.form_elements.content.content_image_url.settings module
- Module contents
- fobi.contrib.plugins.form_elements.content.content_markdown package
- Submodules
- fobi.contrib.plugins.form_elements.content.content_markdown.apps module
- fobi.contrib.plugins.form_elements.content.content_markdown.base module
- fobi.contrib.plugins.form_elements.content.content_markdown.fobi_form_elements module
- fobi.contrib.plugins.form_elements.content.content_markdown.forms module
- fobi.contrib.plugins.form_elements.content.content_markdown.widgets module
- Module contents
- fobi.contrib.plugins.form_elements.content.content_richtext package
- Submodules
- fobi.contrib.plugins.form_elements.content.content_richtext.apps module
- fobi.contrib.plugins.form_elements.content.content_richtext.base module
- fobi.contrib.plugins.form_elements.content.content_richtext.fobi_form_elements module
- fobi.contrib.plugins.form_elements.content.content_richtext.forms module
- fobi.contrib.plugins.form_elements.content.content_richtext.widgets module
- Module contents
- fobi.contrib.plugins.form_elements.content.content_text package
- Submodules
- fobi.contrib.plugins.form_elements.content.content_text.apps module
- fobi.contrib.plugins.form_elements.content.content_text.base module
- fobi.contrib.plugins.form_elements.content.content_text.conf module
- fobi.contrib.plugins.form_elements.content.content_text.defaults module
- fobi.contrib.plugins.form_elements.content.content_text.fobi_form_elements module
- fobi.contrib.plugins.form_elements.content.content_text.forms module
- fobi.contrib.plugins.form_elements.content.content_text.settings module
- Module contents
- fobi.contrib.plugins.form_elements.content.content_video package
- Submodules
- fobi.contrib.plugins.form_elements.content.content_video.apps module
- fobi.contrib.plugins.form_elements.content.content_video.base module
- fobi.contrib.plugins.form_elements.content.content_video.conf module
- fobi.contrib.plugins.form_elements.content.content_video.defaults module
- fobi.contrib.plugins.form_elements.content.content_video.fobi_form_elements module
- fobi.contrib.plugins.form_elements.content.content_video.forms module
- fobi.contrib.plugins.form_elements.content.content_video.settings module
- Module contents
- fobi.contrib.plugins.form_elements.content.content_image package
- Module contents
- Subpackages
- fobi.contrib.plugins.form_elements.fields package
- Subpackages
- fobi.contrib.plugins.form_elements.fields.boolean package
- fobi.contrib.plugins.form_elements.fields.checkbox_select_multiple package
- Submodules
- fobi.contrib.plugins.form_elements.fields.checkbox_select_multiple.apps module
- fobi.contrib.plugins.form_elements.fields.checkbox_select_multiple.base module
- fobi.contrib.plugins.form_elements.fields.checkbox_select_multiple.conf module
- fobi.contrib.plugins.form_elements.fields.checkbox_select_multiple.defaults module
- fobi.contrib.plugins.form_elements.fields.checkbox_select_multiple.fobi_form_elements module
- fobi.contrib.plugins.form_elements.fields.checkbox_select_multiple.forms module
- fobi.contrib.plugins.form_elements.fields.checkbox_select_multiple.settings module
- Module contents
- fobi.contrib.plugins.form_elements.fields.date package
- Submodules
- fobi.contrib.plugins.form_elements.fields.date.apps module
- fobi.contrib.plugins.form_elements.fields.date.base module
- fobi.contrib.plugins.form_elements.fields.date.fobi_form_elements module
- fobi.contrib.plugins.form_elements.fields.date.forms module
- fobi.contrib.plugins.form_elements.fields.date.widgets module
- Module contents
- fobi.contrib.plugins.form_elements.fields.date_drop_down package
- Submodules
- fobi.contrib.plugins.form_elements.fields.date_drop_down.apps module
- fobi.contrib.plugins.form_elements.fields.date_drop_down.base module
- fobi.contrib.plugins.form_elements.fields.date_drop_down.fobi_form_elements module
- fobi.contrib.plugins.form_elements.fields.date_drop_down.forms module
- Module contents
- fobi.contrib.plugins.form_elements.fields.datetime package
- Submodules
- fobi.contrib.plugins.form_elements.fields.datetime.apps module
- fobi.contrib.plugins.form_elements.fields.datetime.base module
- fobi.contrib.plugins.form_elements.fields.datetime.fobi_form_elements module
- fobi.contrib.plugins.form_elements.fields.datetime.forms module
- fobi.contrib.plugins.form_elements.fields.datetime.widgets module
- Module contents
- fobi.contrib.plugins.form_elements.fields.decimal package
- fobi.contrib.plugins.form_elements.fields.duration package
- fobi.contrib.plugins.form_elements.fields.email package
- fobi.contrib.plugins.form_elements.fields.file package
- Submodules
- fobi.contrib.plugins.form_elements.fields.file.apps module
- fobi.contrib.plugins.form_elements.fields.file.base module
- fobi.contrib.plugins.form_elements.fields.file.conf module
- fobi.contrib.plugins.form_elements.fields.file.defaults module
- fobi.contrib.plugins.form_elements.fields.file.fobi_form_elements module
- fobi.contrib.plugins.form_elements.fields.file.forms module
- fobi.contrib.plugins.form_elements.fields.file.settings module
- Module contents
- fobi.contrib.plugins.form_elements.fields.float package
- fobi.contrib.plugins.form_elements.fields.hidden package
- fobi.contrib.plugins.form_elements.fields.input package
- Submodules
- fobi.contrib.plugins.form_elements.fields.input.apps module
- fobi.contrib.plugins.form_elements.fields.input.base module
- fobi.contrib.plugins.form_elements.fields.input.constants module
- fobi.contrib.plugins.form_elements.fields.input.fobi_form_elements module
- fobi.contrib.plugins.form_elements.fields.input.forms module
- Module contents
- fobi.contrib.plugins.form_elements.fields.integer package
- fobi.contrib.plugins.form_elements.fields.ip_address package
- Submodules
- fobi.contrib.plugins.form_elements.fields.ip_address.apps module
- fobi.contrib.plugins.form_elements.fields.ip_address.base module
- fobi.contrib.plugins.form_elements.fields.ip_address.fobi_form_elements module
- fobi.contrib.plugins.form_elements.fields.ip_address.forms module
- Module contents
- fobi.contrib.plugins.form_elements.fields.null_boolean package
- Submodules
- fobi.contrib.plugins.form_elements.fields.null_boolean.apps module
- fobi.contrib.plugins.form_elements.fields.null_boolean.base module
- fobi.contrib.plugins.form_elements.fields.null_boolean.fobi_form_elements module
- fobi.contrib.plugins.form_elements.fields.null_boolean.forms module
- Module contents
- fobi.contrib.plugins.form_elements.fields.password package
- fobi.contrib.plugins.form_elements.fields.radio package
- Submodules
- fobi.contrib.plugins.form_elements.fields.radio.apps module
- fobi.contrib.plugins.form_elements.fields.radio.base module
- fobi.contrib.plugins.form_elements.fields.radio.conf module
- fobi.contrib.plugins.form_elements.fields.radio.defaults module
- fobi.contrib.plugins.form_elements.fields.radio.fobi_form_elements module
- fobi.contrib.plugins.form_elements.fields.radio.forms module
- fobi.contrib.plugins.form_elements.fields.radio.settings module
- Module contents
- fobi.contrib.plugins.form_elements.fields.range_select package
- Submodules
- fobi.contrib.plugins.form_elements.fields.range_select.apps module
- fobi.contrib.plugins.form_elements.fields.range_select.base module
- fobi.contrib.plugins.form_elements.fields.range_select.conf module
- fobi.contrib.plugins.form_elements.fields.range_select.defaults module
- fobi.contrib.plugins.form_elements.fields.range_select.fobi_form_elements module
- fobi.contrib.plugins.form_elements.fields.range_select.forms module
- fobi.contrib.plugins.form_elements.fields.range_select.settings module
- Module contents
- fobi.contrib.plugins.form_elements.fields.regex package
- fobi.contrib.plugins.form_elements.fields.select package
- Submodules
- fobi.contrib.plugins.form_elements.fields.select.apps module
- fobi.contrib.plugins.form_elements.fields.select.base module
- fobi.contrib.plugins.form_elements.fields.select.conf module
- fobi.contrib.plugins.form_elements.fields.select.defaults module
- fobi.contrib.plugins.form_elements.fields.select.fobi_form_elements module
- fobi.contrib.plugins.form_elements.fields.select.forms module
- fobi.contrib.plugins.form_elements.fields.select.settings module
- Module contents
- fobi.contrib.plugins.form_elements.fields.select_model_object package
- Submodules
- fobi.contrib.plugins.form_elements.fields.select_model_object.apps module
- fobi.contrib.plugins.form_elements.fields.select_model_object.base module
- fobi.contrib.plugins.form_elements.fields.select_model_object.conf module
- fobi.contrib.plugins.form_elements.fields.select_model_object.defaults module
- fobi.contrib.plugins.form_elements.fields.select_model_object.fobi_form_elements module
- fobi.contrib.plugins.form_elements.fields.select_model_object.forms module
- fobi.contrib.plugins.form_elements.fields.select_model_object.settings module
- Module contents
- fobi.contrib.plugins.form_elements.fields.select_mptt_model_object package
- Submodules
- fobi.contrib.plugins.form_elements.fields.select_mptt_model_object.apps module
- fobi.contrib.plugins.form_elements.fields.select_mptt_model_object.base module
- fobi.contrib.plugins.form_elements.fields.select_mptt_model_object.conf module
- fobi.contrib.plugins.form_elements.fields.select_mptt_model_object.defaults module
- fobi.contrib.plugins.form_elements.fields.select_mptt_model_object.fobi_form_elements module
- fobi.contrib.plugins.form_elements.fields.select_mptt_model_object.forms module
- fobi.contrib.plugins.form_elements.fields.select_mptt_model_object.settings module
- Module contents
- fobi.contrib.plugins.form_elements.fields.select_multiple package
- Submodules
- fobi.contrib.plugins.form_elements.fields.select_multiple.apps module
- fobi.contrib.plugins.form_elements.fields.select_multiple.base module
- fobi.contrib.plugins.form_elements.fields.select_multiple.conf module
- fobi.contrib.plugins.form_elements.fields.select_multiple.defaults module
- fobi.contrib.plugins.form_elements.fields.select_multiple.fobi_form_elements module
- fobi.contrib.plugins.form_elements.fields.select_multiple.forms module
- fobi.contrib.plugins.form_elements.fields.select_multiple.settings module
- Module contents
- fobi.contrib.plugins.form_elements.fields.select_multiple_model_objects package
- Submodules
- fobi.contrib.plugins.form_elements.fields.select_multiple_model_objects.apps module
- fobi.contrib.plugins.form_elements.fields.select_multiple_model_objects.base module
- fobi.contrib.plugins.form_elements.fields.select_multiple_model_objects.conf module
- fobi.contrib.plugins.form_elements.fields.select_multiple_model_objects.defaults module
- fobi.contrib.plugins.form_elements.fields.select_multiple_model_objects.fobi_form_elements module
- fobi.contrib.plugins.form_elements.fields.select_multiple_model_objects.forms module
- fobi.contrib.plugins.form_elements.fields.select_multiple_model_objects.settings module
- Module contents
- fobi.contrib.plugins.form_elements.fields.select_multiple_mptt_model_objects package
- Submodules
- fobi.contrib.plugins.form_elements.fields.select_multiple_mptt_model_objects.apps module
- fobi.contrib.plugins.form_elements.fields.select_multiple_mptt_model_objects.base module
- fobi.contrib.plugins.form_elements.fields.select_multiple_mptt_model_objects.conf module
- fobi.contrib.plugins.form_elements.fields.select_multiple_mptt_model_objects.defaults module
- fobi.contrib.plugins.form_elements.fields.select_multiple_mptt_model_objects.fobi_form_elements module
- fobi.contrib.plugins.form_elements.fields.select_multiple_mptt_model_objects.forms module
- fobi.contrib.plugins.form_elements.fields.select_multiple_mptt_model_objects.settings module
- Module contents
- fobi.contrib.plugins.form_elements.fields.select_multiple_with_max package
- Submodules
- fobi.contrib.plugins.form_elements.fields.select_multiple_with_max.apps module
- fobi.contrib.plugins.form_elements.fields.select_multiple_with_max.base module
- fobi.contrib.plugins.form_elements.fields.select_multiple_with_max.conf module
- fobi.contrib.plugins.form_elements.fields.select_multiple_with_max.defaults module
- fobi.contrib.plugins.form_elements.fields.select_multiple_with_max.fields module
- fobi.contrib.plugins.form_elements.fields.select_multiple_with_max.fobi_form_elements module
- fobi.contrib.plugins.form_elements.fields.select_multiple_with_max.forms module
- fobi.contrib.plugins.form_elements.fields.select_multiple_with_max.settings module
- Module contents
- fobi.contrib.plugins.form_elements.fields.slider package
- Submodules
- fobi.contrib.plugins.form_elements.fields.slider.apps module
- fobi.contrib.plugins.form_elements.fields.slider.base module
- fobi.contrib.plugins.form_elements.fields.slider.conf module
- fobi.contrib.plugins.form_elements.fields.slider.constants module
- fobi.contrib.plugins.form_elements.fields.slider.defaults module
- fobi.contrib.plugins.form_elements.fields.slider.fobi_form_elements module
- fobi.contrib.plugins.form_elements.fields.slider.forms module
- fobi.contrib.plugins.form_elements.fields.slider.helpers module
- fobi.contrib.plugins.form_elements.fields.slider.settings module
- fobi.contrib.plugins.form_elements.fields.slider.widgets module
- Module contents
- fobi.contrib.plugins.form_elements.fields.slug package
- fobi.contrib.plugins.form_elements.fields.text package
- fobi.contrib.plugins.form_elements.fields.textarea package
- fobi.contrib.plugins.form_elements.fields.time package
- fobi.contrib.plugins.form_elements.fields.url package
- Module contents
- Subpackages
- fobi.contrib.plugins.form_elements.security package
- Subpackages
- fobi.contrib.plugins.form_elements.security.captcha package
- fobi.contrib.plugins.form_elements.security.honeypot package
- Submodules
- fobi.contrib.plugins.form_elements.security.honeypot.apps module
- fobi.contrib.plugins.form_elements.security.honeypot.base module
- fobi.contrib.plugins.form_elements.security.honeypot.conf module
- fobi.contrib.plugins.form_elements.security.honeypot.defaults module
- fobi.contrib.plugins.form_elements.security.honeypot.fields module
- fobi.contrib.plugins.form_elements.security.honeypot.fobi_form_elements module
- fobi.contrib.plugins.form_elements.security.honeypot.forms module
- fobi.contrib.plugins.form_elements.security.honeypot.settings module
- Module contents
- fobi.contrib.plugins.form_elements.security.recaptcha package
- Submodules
- fobi.contrib.plugins.form_elements.security.recaptcha.apps module
- fobi.contrib.plugins.form_elements.security.recaptcha.base module
- fobi.contrib.plugins.form_elements.security.recaptcha.fobi_form_elements module
- fobi.contrib.plugins.form_elements.security.recaptcha.forms module
- Module contents
- Module contents
- Subpackages
- fobi.contrib.plugins.form_elements.test package
- fobi.contrib.plugins.form_elements.content package
- Module contents
- Subpackages
- fobi.contrib.plugins.form_handlers package
- Subpackages
- fobi.contrib.plugins.form_handlers.db_store package
- Subpackages
- Submodules
- fobi.contrib.plugins.form_handlers.db_store.admin module
- fobi.contrib.plugins.form_handlers.db_store.apps module
- fobi.contrib.plugins.form_handlers.db_store.base module
- fobi.contrib.plugins.form_handlers.db_store.callbacks module
- fobi.contrib.plugins.form_handlers.db_store.conf module
- fobi.contrib.plugins.form_handlers.db_store.defaults module
- fobi.contrib.plugins.form_handlers.db_store.fobi_form_handlers module
- fobi.contrib.plugins.form_handlers.db_store.helpers module
- fobi.contrib.plugins.form_handlers.db_store.models module
- fobi.contrib.plugins.form_handlers.db_store.settings module
- fobi.contrib.plugins.form_handlers.db_store.views module
- fobi.contrib.plugins.form_handlers.db_store.widgets module
- Module contents
- fobi.contrib.plugins.form_handlers.http_repost package
- fobi.contrib.plugins.form_handlers.mail package
- Submodules
- fobi.contrib.plugins.form_handlers.mail.apps module
- fobi.contrib.plugins.form_handlers.mail.base module
- fobi.contrib.plugins.form_handlers.mail.callbacks module
- fobi.contrib.plugins.form_handlers.mail.conf module
- fobi.contrib.plugins.form_handlers.mail.defaults module
- fobi.contrib.plugins.form_handlers.mail.fields module
- fobi.contrib.plugins.form_handlers.mail.fobi_form_handlers module
- fobi.contrib.plugins.form_handlers.mail.forms module
- fobi.contrib.plugins.form_handlers.mail.helpers module
- fobi.contrib.plugins.form_handlers.mail.mixins module
- fobi.contrib.plugins.form_handlers.mail.settings module
- fobi.contrib.plugins.form_handlers.mail.widgets module
- Module contents
- fobi.contrib.plugins.form_handlers.db_store package
- Module contents
- Subpackages
- fobi.contrib.plugins.form_importers package
- Subpackages
- fobi.contrib.plugins.form_importers.mailchimp_importer package
- Submodules
- fobi.contrib.plugins.form_importers.mailchimp_importer.apps module
- fobi.contrib.plugins.form_importers.mailchimp_importer.base module
- fobi.contrib.plugins.form_importers.mailchimp_importer.fobi_form_importers module
- fobi.contrib.plugins.form_importers.mailchimp_importer.forms module
- fobi.contrib.plugins.form_importers.mailchimp_importer.views module
- Module contents
- fobi.contrib.plugins.form_importers.mailchimp_importer package
- Module contents
- Subpackages
- fobi.contrib.plugins.form_elements package
- Module contents
- Subpackages
- fobi.contrib.themes package
- Subpackages
- fobi.contrib.themes.bootstrap3 package
- Subpackages
- fobi.contrib.themes.bootstrap3.widgets package
- Subpackages
- fobi.contrib.themes.bootstrap3.widgets.form_elements package
- Subpackages
- fobi.contrib.themes.bootstrap3.widgets.form_elements.content_markdown_bootstrap3_widget package
- fobi.contrib.themes.bootstrap3.widgets.form_elements.content_richtext_bootstrap3_widget package
- fobi.contrib.themes.bootstrap3.widgets.form_elements.date_bootstrap3_widget package
- fobi.contrib.themes.bootstrap3.widgets.form_elements.datetime_bootstrap3_widget package
- fobi.contrib.themes.bootstrap3.widgets.form_elements.dummy_bootstrap3_widget package
- fobi.contrib.themes.bootstrap3.widgets.form_elements.slider_bootstrap3_widget package
- Module contents
- Subpackages
- fobi.contrib.themes.bootstrap3.widgets.form_elements package
- Module contents
- Subpackages
- fobi.contrib.themes.bootstrap3.widgets package
- Submodules
- fobi.contrib.themes.bootstrap3.apps module
- fobi.contrib.themes.bootstrap3.fobi_themes module
- Module contents
- Subpackages
- fobi.contrib.themes.djangocms_admin_style_theme package
- Subpackages
- fobi.contrib.themes.djangocms_admin_style_theme.widgets package
- Subpackages
- fobi.contrib.themes.djangocms_admin_style_theme.widgets.form_elements package
- fobi.contrib.themes.djangocms_admin_style_theme.widgets.form_handlers package
- Module contents
- Subpackages
- fobi.contrib.themes.djangocms_admin_style_theme.widgets package
- Submodules
- fobi.contrib.themes.djangocms_admin_style_theme.apps module
- fobi.contrib.themes.djangocms_admin_style_theme.fobi_themes module
- Module contents
- Subpackages
- fobi.contrib.themes.foundation5 package
- Subpackages
- fobi.contrib.themes.foundation5.widgets package
- Subpackages
- fobi.contrib.themes.foundation5.widgets.form_elements package
- Subpackages
- fobi.contrib.themes.foundation5.widgets.form_elements.content_richtext_foundation5_widget package
- fobi.contrib.themes.foundation5.widgets.form_elements.date_foundation5_widget package
- fobi.contrib.themes.foundation5.widgets.form_elements.datetime_foundation5_widget package
- fobi.contrib.themes.foundation5.widgets.form_elements.dummy_foundation5_widget package
- Module contents
- Subpackages
- fobi.contrib.themes.foundation5.widgets.form_handlers package
- fobi.contrib.themes.foundation5.widgets.form_elements package
- Module contents
- Subpackages
- fobi.contrib.themes.foundation5.widgets package
- Submodules
- fobi.contrib.themes.foundation5.apps module
- fobi.contrib.themes.foundation5.fobi_themes module
- Module contents
- Subpackages
- fobi.contrib.themes.simple package
- Subpackages
- fobi.contrib.themes.simple.widgets package
- Submodules
- fobi.contrib.themes.simple.apps module
- fobi.contrib.themes.simple.fobi_themes module
- Module contents
- Subpackages
- fobi.contrib.themes.bootstrap3 package
- Module contents
- Subpackages
- fobi.contrib.apps package
- Module contents
- Subpackages
- fobi.integration package
- fobi.management package
- fobi.migrations package
- Submodules
- fobi.migrations.0001_initial module
- fobi.migrations.0002_auto_20150912_1744 module
- fobi.migrations.0003_auto_20160517_1005 module
- fobi.migrations.0004_auto_20160906_1513 module
- fobi.migrations.0005_auto_20160908_1457 module
- fobi.migrations.0006_auto_20160911_1549 module
- fobi.migrations.0007_auto_20160926_1652 module
- fobi.migrations.0008_formwizardhandlerentry module
- fobi.migrations.0009_formwizardentry_wizard_type module
- fobi.migrations.0010_formwizardhandler module
- fobi.migrations.0011_formentry_title module
- fobi.migrations.0012_auto_20161109_1550 module
- fobi.migrations.0013_formwizardentry_show_all_navigation_buttons module
- fobi.migrations.0014_auto_20170516_1413 module
- Module contents
- fobi.reusable package
- fobi.templatetags package
- fobi.tests package
- Submodules
- fobi.tests.base module
- fobi.tests.constants module
- fobi.tests.core module
- fobi.tests.data module
- fobi.tests.helpers module
- fobi.tests.test_browser_build_dynamic_forms module
- fobi.tests.test_core module
- fobi.tests.test_drf_integration module
- fobi.tests.test_dynamic_forms module
- fobi.tests.test_feincms_integration module
- fobi.tests.test_form_importers_mailchimp module
- fobi.tests.test_sortable_dict module
- Module contents
- fobi.urls package
- fobi.wizard package
- fobi.contrib package
- Submodules
- fobi.admin module
- fobi.app module
- fobi.apps module
- fobi.base module
- fobi.conf module
- fobi.constants module
- fobi.context_processors module
- fobi.data_structures module
- fobi.decorators module
- fobi.defaults module
- fobi.discover module
- fobi.dynamic module
- fobi.exceptions module
- fobi.form_importers module
- fobi.form_utils module
- fobi.forms module
- fobi.helpers module
- fobi.models module
- fobi.settings module
- fobi.test module
- fobi.utils module
- fobi.validators module
- fobi.views module
- fobi.widgets module
- Module contents
- Subpackages
Indices and tables¶
(Sub)modules¶
Some additional documentation on django-fobi
sub-modules are listed
below.
fobi.contrib.apps.djangocms_integration¶
A django-fobi
integration with DjangoCMS.
Prerequisites¶
Tested with DjangoCMS 2.4.3, 3.0.6 and 3.4.3 only. Might work on earlier (or later) versions as well.
Installation¶
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
- 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_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.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_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¶
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.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.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_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_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_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.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.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.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¶
- Add
fobi.contrib.plugins.form_elements.security.recaptcha
to the
INSTALLED_APPS
in yoursettings.py
.INSTALLED_APPS = ( # ... 'fobi.contrib.plugins.form_elements.security.recaptcha', # ... )
In the terminal type:
./manage.py fobi_sync_plugins
Assign appropriate permissions to the target users/groups to be using
the plugin ifFOBI_RESTRICT_PLUGIN_ACCESS
is set to True.
Specify the following ReCAPTCHA credentials in your settings:
- ``RECAPTCHA_PUBLIC_KEY`` - ``RECAPTCHA_PRIVATE_KEY``
Troubleshooting and usage limitations¶
In combination with other captcha solutions¶
At the moment, you can’t use both CAPTCHA
(fobi.contrib.plugins.form_elements.security.captcha) and ReCAPTCHA
(fobi.contrib.plugins.form_elements.security.recaptcha) plugins alongside due
to app name collision of the django-simple-captcha
and django-recaptcha
packages.
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.
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.
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.
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'