apis_core.generic.forms package

class apis_core.generic.forms.GenericEnrichForm(*args, **kwargs)[source]

Bases: Form

base_fields = {}
declared_fields = {}
property media

Return all media required to render the widgets on this form.

class apis_core.generic.forms.GenericFilterSetForm(*args, **kwargs)[source]

Bases: Form

FilterSet form for generic models Adds a submit button using the django crispy form helper Adds a columns selector that lists all the fields from the model

base_fields = {}
clean()[source]

Hook for doing any extra form-wide cleaning after Field.clean() has been called on every field. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field named ‘__all__’.

columns_exclude = []
declared_fields = {}
property media

Return all media required to render the widgets on this form.

class apis_core.generic.forms.GenericImportForm(*args, **kwargs)[source]

Bases: Form

class Meta[source]

Bases: object

fields = []
base_fields = {}
declared_fields = {}
property media

Return all media required to render the widgets on this form.

class apis_core.generic.forms.GenericMergeWithForm(*args, **kwargs)[source]

Bases: Form

base_fields = {}
declared_fields = {}
property media

Return all media required to render the widgets on this form.

class apis_core.generic.forms.GenericModelForm(*args, **kwargs)[source]

Bases: ModelForm

Model form for generic models Adds a submit button using the django crispy form helper and sets the ModelChoiceFields and ModelMultipleChoiceFields to use autocomplete replacement fields

class Meta[source]

Bases: object

fields = '__all__'
base_fields = {}
declared_fields = {}
property media

Return all media required to render the widgets on this form.

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

Save this form’s self.instance object if commit=True. Otherwise, add a save_m2m() method to the form which can be called after the instance is saved manually at a later time. Return the model instance.

class apis_core.generic.forms.GenericSelectMergeOrEnrichForm(*args, **kwargs)[source]

Bases: Form

base_fields = {}
declared_fields = {}
property media

Return all media required to render the widgets on this form.

Submodules

apis_core.generic.forms.fields module

class apis_core.generic.forms.fields.IncludeExcludeField(field, *args, **kwargs)[source]

Bases: MultiValueField

This is a custom MultiValueField that adds a ChoiceField that only provides two choices, namely exclude and include. It can be used for django-filter filters to specify which action should be done with the filter.

compress(data_list)[source]

Return a single value for the given list of values. The values can be assumed to be valid.

For example, if this MultiValueField was instantiated with fields=(DateField(), TimeField()), this might return a datetime object created by combining the date and time in data_list.

class apis_core.generic.forms.fields.IncludeExcludeMultiWidget(widgets, attrs=None)[source]

Bases: MultiWidget

decompress(value)[source]

Return a list of decompressed values for the given compressed value. The given value can be assumed to be valid, but not necessarily non-empty.

property media

Media for a multiwidget is the combination of all media of the subwidgets.

template_name = 'widgets/includeexclude_multiwidget.html'
use_fieldset = False
class apis_core.generic.forms.fields.ModelImportChoiceField(queryset, *, empty_label='---------', required=True, widget=None, label=None, initial=None, help_text='', to_field_name=None, limit_choices_to=None, blank=False, **kwargs)[source]

Bases: ModelChoiceField

to_python(value)[source]

Return a string.

apis_core.generic.forms.widgets module

class apis_core.generic.forms.widgets.JSONListWidget(attrs=None)[source]

Bases: Input

class Media[source]

Bases: object

js = ['js/multiline.js']
format_value(value)[source]

Return a value as it should appear when rendered in a template.

input_type = 'text'
property media
template_name = 'widgets/multiline.html'
value_from_datadict(data, files, name)[source]

Given a dictionary of data and this widget’s name, return the value of this widget or None if it’s not provided.

class apis_core.generic.forms.widgets.NewlineSeparatedListWidget(attrs=None)[source]

Bases: Input

class Media[source]

Bases: object

js = ['js/multiline.js']
format_value(value)[source]

Return a value as it should appear when rendered in a template.

input_type = 'text'
property media
template_name = 'widgets/multiline.html'
value_from_datadict(data, files, name)[source]

Given a dictionary of data and this widget’s name, return the value of this widget or None if it’s not provided.