fobi.contrib.plugins.form_handlers.db_store package

Submodules

fobi.contrib.plugins.form_handlers.db_store.admin module

class fobi.contrib.plugins.form_handlers.db_store.admin.SavedFormDataEntryAdmin(model, admin_site)[source]

Bases: fobi.contrib.plugins.form_handlers.db_store.admin.BaseSavedFormDataEntryAdmin

Saved form data entry admin.

class Meta[source]

Meta class.

app_label = <django.utils.functional.__proxy__ object>
SavedFormDataEntryAdmin.actions = ['export_data']
SavedFormDataEntryAdmin.fieldsets = ((None, {'fields': ('form_entry', 'user')}), (<django.utils.functional.__proxy__ object at 0x7f274d878450>, {'fields': ('formatted_saved_data', 'created')}), (<django.utils.functional.__proxy__ object at 0x7f274d8786d0>, {'fields': ('form_data_headers', 'saved_data'), 'classes': ('collapse',)}))
SavedFormDataEntryAdmin.list_display = ('form_entry', 'user', 'formatted_saved_data', 'created')
SavedFormDataEntryAdmin.list_filter = ('form_entry', 'user')
SavedFormDataEntryAdmin.media
SavedFormDataEntryAdmin.readonly_fields = ('created', 'formatted_saved_data')
class fobi.contrib.plugins.form_handlers.db_store.admin.SavedFormWizardDataEntryAdmin(model, admin_site)[source]

Bases: fobi.contrib.plugins.form_handlers.db_store.admin.BaseSavedFormDataEntryAdmin

Saved form wizard data entry admin.

class Meta[source]

Meta class.

app_label = <django.utils.functional.__proxy__ object>
SavedFormWizardDataEntryAdmin.actions = ['export_data']
SavedFormWizardDataEntryAdmin.fieldsets = ((None, {'fields': ('form_wizard_entry', 'user')}), (<django.utils.functional.__proxy__ object at 0x7f274d878790>, {'fields': ('formatted_saved_data', 'created')}), (<django.utils.functional.__proxy__ object at 0x7f274d8788d0>, {'fields': ('form_data_headers', 'saved_data'), 'classes': ('collapse',)}))
SavedFormWizardDataEntryAdmin.list_display = ('form_wizard_entry', 'user', 'formatted_saved_data', 'created')
SavedFormWizardDataEntryAdmin.list_filter = ('form_wizard_entry', 'user')
SavedFormWizardDataEntryAdmin.media
SavedFormWizardDataEntryAdmin.readonly_fields = ('created', 'formatted_saved_data')

fobi.contrib.plugins.form_handlers.db_store.apps module

class fobi.contrib.plugins.form_handlers.db_store.apps.Config(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

Config.

label = 'fobi_contrib_plugins_form_handlers_db_store'
name = 'fobi.contrib.plugins.form_handlers.db_store'

fobi.contrib.plugins.form_handlers.db_store.conf module

fobi.contrib.plugins.form_handlers.db_store.conf.get_setting(setting, override=None)[source]

Get setting.

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

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

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

Setting value.

fobi.contrib.plugins.form_handlers.db_store.defaults module

fobi.contrib.plugins.form_handlers.db_store.fobi_form_handlers module

class fobi.contrib.plugins.form_handlers.db_store.fobi_form_handlers.DBStoreHandlerPlugin(user=None)[source]

Bases: fobi.base.FormHandlerPlugin

DB store form handler plugin.

Can be used only once per form.

allow_multiple = False
custom_actions(form_entry, request=None)[source]

Custom actions.

Adding a link to view the saved form entries.

Return iterable:
 
name = <django.utils.functional.__proxy__ object>
run(form_entry, request, form, form_element_entries=None)[source]

Run.

Parameters:
  • form_entry (fobi.models.FormEntry) – Instance of fobi.models.FormEntry.
  • request (django.http.HttpRequest) –
  • form (django.forms.Form) –
  • form_element_entries (iterable) – Iterable of fobi.models.FormElementEntry objects.
uid = 'db_store'
class fobi.contrib.plugins.form_handlers.db_store.fobi_form_handlers.DBStoreWizardHandlerPlugin(user=None)[source]

Bases: fobi.base.FormWizardHandlerPlugin

DB store form wizard handler plugin.

Can be used only once per form.

allow_multiple = False
custom_actions(form_wizard_entry, request=None)[source]

Custom actions.

Adding a link to view the saved form entries.

Return iterable:
 
name = <django.utils.functional.__proxy__ object>
run(form_wizard_entry, request, form_list, form_wizard, form_element_entries=None)[source]

Run.

Parameters:
uid = 'db_store'

fobi.contrib.plugins.form_handlers.db_store.helpers module

class fobi.contrib.plugins.form_handlers.db_store.helpers.DataExporter(queryset)[source]

Bases: object

Exporting the data.

export_to_csv()[source]

Export data to CSV.

export_to_xls()[source]

Export data to XLS.

graceful_export()[source]

Export data into XLS/CSV depending on what is available.

fobi.contrib.plugins.form_handlers.db_store.models module

class fobi.contrib.plugins.form_handlers.db_store.models.AbstractSavedFormDataEntry(*args, **kwargs)[source]

Bases: django.db.models.base.Model

Abstract saved form data entry.

class Meta[source]

Meta class.

abstract = False
AbstractSavedFormDataEntry.created

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

AbstractSavedFormDataEntry.form_data_headers

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

AbstractSavedFormDataEntry.formatted_saved_data()[source]

Shows the formatted saved data records.

Return string:
AbstractSavedFormDataEntry.get_next_by_created(*moreargs, **morekwargs)
AbstractSavedFormDataEntry.get_previous_by_created(*moreargs, **morekwargs)
AbstractSavedFormDataEntry.saved_data

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

AbstractSavedFormDataEntry.user

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

In the example:

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

child.parent is a ForwardManyToOneDescriptor instance.

AbstractSavedFormDataEntry.user_id

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

class fobi.contrib.plugins.form_handlers.db_store.models.SavedFormDataEntry(*args, **kwargs)[source]

Bases: fobi.contrib.plugins.form_handlers.db_store.models.AbstractSavedFormDataEntry

Saved form data.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception SavedFormDataEntry.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

SavedFormDataEntry.form_entry

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

In the example:

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

child.parent is a ForwardManyToOneDescriptor instance.

SavedFormDataEntry.form_entry_id

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

SavedFormDataEntry.get_next_by_created(*moreargs, **morekwargs)
SavedFormDataEntry.get_previous_by_created(*moreargs, **morekwargs)
SavedFormDataEntry.id

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

SavedFormDataEntry.objects = <django.db.models.manager.Manager object>
SavedFormDataEntry.user

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

In the example:

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

child.parent is a ForwardManyToOneDescriptor instance.

class fobi.contrib.plugins.form_handlers.db_store.models.SavedFormWizardDataEntry(*args, **kwargs)[source]

Bases: fobi.contrib.plugins.form_handlers.db_store.models.AbstractSavedFormDataEntry

Saved form data.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception SavedFormWizardDataEntry.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

SavedFormWizardDataEntry.form_wizard_entry

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

In the example:

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

child.parent is a ForwardManyToOneDescriptor instance.

SavedFormWizardDataEntry.form_wizard_entry_id

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

SavedFormWizardDataEntry.get_next_by_created(*moreargs, **morekwargs)
SavedFormWizardDataEntry.get_previous_by_created(*moreargs, **morekwargs)
SavedFormWizardDataEntry.id

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

SavedFormWizardDataEntry.objects = <django.db.models.manager.Manager object>
SavedFormWizardDataEntry.user

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

In the example:

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

child.parent is a ForwardManyToOneDescriptor instance.

fobi.contrib.plugins.form_handlers.db_store.settings module

  • CSV_DELIMITER (string)
  • CSV_QUOTECHAR (string)

fobi.contrib.plugins.form_handlers.db_store.views module

fobi.contrib.plugins.form_handlers.db_store.views.view_saved_form_data_entries(request, *args, **kwargs)[source]

View saved form data entries.

Parameters:
  • request (django.http.HttpRequest) –
  • form_entry_id (int) – Form ID.
  • theme (fobi.base.BaseTheme) – Subclass of fobi.base.BaseTheme.
  • template_name (string) –
Return django.http.HttpResponse:
 
fobi.contrib.plugins.form_handlers.db_store.views.export_saved_form_data_entries(request, *args, **kwargs)[source]

Export saved form data entries.

Parameters:
  • request (django.http.HttpRequest) –
  • form_entry_id (int) – Form ID.
  • theme (fobi.base.BaseTheme) – Subclass of fobi.base.BaseTheme.
Return django.http.HttpResponse:
 
fobi.contrib.plugins.form_handlers.db_store.views.view_saved_form_wizard_data_entries(request, *args, **kwargs)[source]

View saved form wizard data entries.

Parameters:
  • request (django.http.HttpRequest) –
  • form_wizard_entry_id (int) – Form ID.
  • theme (fobi.base.BaseTheme) – Subclass of fobi.base.BaseTheme.
  • template_name (string) –
Return django.http.HttpResponse:
 
fobi.contrib.plugins.form_handlers.db_store.views.export_saved_form_wizard_data_entries(request, *args, **kwargs)[source]

Export saved form wizard data entries.

Parameters:
  • request (django.http.HttpRequest) –
  • form_wizard_entry_id (int) – Form ID.
  • theme (fobi.base.BaseTheme) – Subclass of fobi.base.BaseTheme.
Return django.http.HttpResponse:
 

fobi.contrib.plugins.form_handlers.db_store.widgets module

class fobi.contrib.plugins.form_handlers.db_store.widgets.BaseDbStorePluginWidget(plugin)[source]

Bases: fobi.base.FormHandlerPluginWidget

Base dummy form element plugin widget.

export_entries_icon_class = 'glyphicon glyphicon-export'
plugin_uid = 'db_store'
view_entries_icon_class = 'glyphicon glyphicon-list'
view_saved_form_data_entries_template_name = 'db_store/view_saved_form_data_entries.html'

Module contents