tags_input.fields module

class tags_input.fields.AdminTagsInputField(queryset, verbose_name=None, *args, **kwargs)[source]

Bases: tags_input.fields.TagsInputField

bound_data(data, initial)

Return the value that should be shown for this field on render of a bound form, given the submitted POST data for the field and the initial data, if any.

For most fields, this will simply be data; FileFields need to handle it a bit differently.

choices
clean(value)
creation_counter = 2
default_error_messages
default_validators = []
empty_values = [None, u'', [], (), {}]
get_bound_field(form, field_name)

Return a BoundField instance that will be used when accessing the form field in a template.

get_limit_choices_to()

Returns limit_choices_to for this form field.

If it is a callable, it will be invoked and the result will be returned.

get_mapping()
has_changed(initial, data)
hidden_widget

alias of MultipleHiddenInput

iterator

alias of ModelChoiceIterator

label_from_instance(obj)

This method is used to convert objects into strings; it’s used to generate the labels for the choices presented by this object. Subclasses can override this method to customize the display of the choices.

prepare_value(value)
queryset
run_validators(value)
to_python(value)
valid_value(value)

Check to see if the provided value is a valid choice

validate(value)
widget

alias of AdminTagsInputWidget

widget_attrs(widget)

Given a Widget instance (not a Widget class), returns a dictionary of any HTML attributes that should be added to the Widget, based on this Field.

class tags_input.fields.TagsInputField(queryset, **kwargs)[source]

Bases: django.forms.models.ModelMultipleChoiceField

bound_data(data, initial)

Return the value that should be shown for this field on render of a bound form, given the submitted POST data for the field and the initial data, if any.

For most fields, this will simply be data; FileFields need to handle it a bit differently.

choices
clean(value)[source]
creation_counter = 2
default_error_messages
default_validators = []
empty_values = [None, u'', [], (), {}]
get_bound_field(form, field_name)

Return a BoundField instance that will be used when accessing the form field in a template.

get_limit_choices_to()

Returns limit_choices_to for this form field.

If it is a callable, it will be invoked and the result will be returned.

get_mapping()[source]
has_changed(initial, data)
hidden_widget

alias of MultipleHiddenInput

iterator

alias of ModelChoiceIterator

label_from_instance(obj)

This method is used to convert objects into strings; it’s used to generate the labels for the choices presented by this object. Subclasses can override this method to customize the display of the choices.

prepare_value(value)
queryset
run_validators(value)
to_python(value)
valid_value(value)

Check to see if the provided value is a valid choice

validate(value)
widget

alias of TagsInputWidget

widget_attrs(widget)

Given a Widget instance (not a Widget class), returns a dictionary of any HTML attributes that should be added to the Widget, based on this Field.