apis_core.generic.forms.fields#

Module Contents#

Classes#

ModelImportChoiceField

RowColumnMultiWidget

A custom MultiWidget that is meant to be used with the RowColumnMultiValueField. The widget takes a list of widgets as a parameter and displays those widgets in columns in one row. The labels parameter is used to add a separate label to the individual widgets.

RowColumnMultiValueField

This is a custom MultiValueField that simply shows multiple form fields in a row. The form fields are passed to the constructor and the corresponding RowColumnMultiWidget simply iterates through all the fields and shows them in rows. Additionaly it is possible to pass a list of labels that are then also passed on to the widget, which uses those to add a separate label to the individual widgets.

API#

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)#

Bases: django.forms.ModelChoiceField

to_python(value)#
class apis_core.generic.forms.fields.RowColumnMultiWidget(widgets, labels=[], attrs=None)#

Bases: django.forms.MultiWidget

A custom MultiWidget that is meant to be used with the RowColumnMultiValueField. The widget takes a list of widgets as a parameter and displays those widgets in columns in one row. The labels parameter is used to add a separate label to the individual widgets.

Initialization

template_name = 'widgets/row_column_multiwidget.html'#
use_fieldset = False#
get_context(name, value, attrs)#
decompress(value)#
class apis_core.generic.forms.fields.RowColumnMultiValueField(fields, labels=[], *args, **kwargs)#

Bases: django.forms.MultiValueField

This is a custom MultiValueField that simply shows multiple form fields in a row. The form fields are passed to the constructor and the corresponding RowColumnMultiWidget simply iterates through all the fields and shows them in rows. Additionaly it is possible to pass a list of labels that are then also passed on to the widget, which uses those to add a separate label to the individual widgets.

Initialization

compress(data_list)#