tags_input.widgets module

class tags_input.widgets.AdminTagsInputWidget(verbose_name, is_stacked, attrs=None, choices=())[source]

Bases: django.contrib.admin.widgets.FilteredSelectMultiple, tags_input.widgets.TagsInputWidgetBase

class Media[source]
css = {'all': ('css/jquery.tagsinput.css', 'css/base/jquery.ui.all.css')}
js = ('js/jquery-1.7.2.min.js', 'js/jquery-ui-18.1.16.min.js', 'js/jquery.tagsinput.js')
AdminTagsInputWidget.add_id_index = False
AdminTagsInputWidget.allow_multiple_selected = True
AdminTagsInputWidget.build_attrs(base_attrs, extra_attrs=None, **kwargs)

Compatibility function for the behavior changes in Django 1.11+

AdminTagsInputWidget.checked_attribute = {u'selected': True}
AdminTagsInputWidget.create_option(name, value, label, selected, index, subindex=None, attrs=None)
AdminTagsInputWidget.format_value(value)

Return selected values as a list.

AdminTagsInputWidget.get_context(name, value, attrs)
AdminTagsInputWidget.id_for_label(id_, index=u'0')

Use an incremented id for each option where the main widget references the zero index.

AdminTagsInputWidget.input_type = u'select'
AdminTagsInputWidget.is_hidden
AdminTagsInputWidget.is_localized = False
AdminTagsInputWidget.is_required = False
AdminTagsInputWidget.media
AdminTagsInputWidget.needs_multipart_form = False
AdminTagsInputWidget.optgroups(name, value, attrs=None)

Return a list of optgroups for this widget.

AdminTagsInputWidget.option_inherits_attrs = False
AdminTagsInputWidget.option_template_name = u'django/forms/widgets/select_option.html'
AdminTagsInputWidget.options(name, value, attrs=None)

Yield a flat list of options for this widgets.

AdminTagsInputWidget.render(name, value, attrs=None, choices=())
AdminTagsInputWidget.subwidgets(name, value, attrs=None)

Yield all “subwidgets” of this widget. Used to enable iterating options from a BoundField for choice widgets.

AdminTagsInputWidget.supports_microseconds = True
AdminTagsInputWidget.template_name = u'django/forms/widgets/select.html'
AdminTagsInputWidget.use_required_attribute(initial)

Don’t render ‘required’ if the first <option> has a value, as that’s invalid HTML.

AdminTagsInputWidget.value_from_datadict(data, files, name)
AdminTagsInputWidget.value_omitted_from_data(data, files, name)
class tags_input.widgets.TagsInputWidget(on_add_tag=None, on_remove_tag=None, on_change_tag=None, *args, **kwargs)[source]

Bases: tags_input.widgets.TagsInputWidgetBase

class Media[source]
css = {'all': ('css/jquery.tagsinput.css', 'css/base/jquery.ui.all.css')}
enable_jquery = True
js = ('js/jquery-1.7.2.min.js', 'js/jquery-ui-18.1.16.min.js', 'js/jquery.tagsinput.js')
TagsInputWidget.add_id_index = False
TagsInputWidget.allow_multiple_selected = True
TagsInputWidget.build_attrs(base_attrs, extra_attrs=None, **kwargs)

Compatibility function for the behavior changes in Django 1.11+

TagsInputWidget.checked_attribute = {u'selected': True}
TagsInputWidget.create_option(name, value, label, selected, index, subindex=None, attrs=None)
TagsInputWidget.format_value(value)

Return selected values as a list.

TagsInputWidget.get_context(name, value, attrs)
TagsInputWidget.id_for_label(id_, index=u'0')

Use an incremented id for each option where the main widget references the zero index.

TagsInputWidget.input_type = u'select'
TagsInputWidget.is_hidden
TagsInputWidget.is_localized = False
TagsInputWidget.is_required = False
TagsInputWidget.media
TagsInputWidget.needs_multipart_form = False
TagsInputWidget.optgroups(name, value, attrs=None)

Return a list of optgroups for this widget.

TagsInputWidget.option_inherits_attrs = False
TagsInputWidget.option_template_name = u'django/forms/widgets/select_option.html'
TagsInputWidget.options(name, value, attrs=None)

Yield a flat list of options for this widgets.

TagsInputWidget.render(name, value, attrs=None, choices=())
TagsInputWidget.subwidgets(name, value, attrs=None)

Yield all “subwidgets” of this widget. Used to enable iterating options from a BoundField for choice widgets.

TagsInputWidget.supports_microseconds = True
TagsInputWidget.template_name = u'django/forms/widgets/select.html'
TagsInputWidget.use_required_attribute(initial)

Don’t render ‘required’ if the first <option> has a value, as that’s invalid HTML.

TagsInputWidget.value_from_datadict(data, files, name)
TagsInputWidget.value_omitted_from_data(data, files, name)
class tags_input.widgets.TagsInputWidgetBase(on_add_tag=None, on_remove_tag=None, on_change_tag=None, *args, **kwargs)[source]

Bases: django.forms.widgets.SelectMultiple

add_id_index = False
allow_multiple_selected = True
build_attrs(base_attrs, extra_attrs=None, **kwargs)[source]

Compatibility function for the behavior changes in Django 1.11+

checked_attribute = {u'selected': True}
create_option(name, value, label, selected, index, subindex=None, attrs=None)
format_value(value)

Return selected values as a list.

get_context(name, value, attrs)
id_for_label(id_, index=u'0')

Use an incremented id for each option where the main widget references the zero index.

input_type = u'select'
is_hidden
is_localized = False
is_required = False
media
needs_multipart_form = False
optgroups(name, value, attrs=None)

Return a list of optgroups for this widget.

option_inherits_attrs = False
option_template_name = u'django/forms/widgets/select_option.html'
options(name, value, attrs=None)

Yield a flat list of options for this widgets.

render(name, value, attrs=None, choices=())[source]
subwidgets(name, value, attrs=None)

Yield all “subwidgets” of this widget. Used to enable iterating options from a BoundField for choice widgets.

supports_microseconds = True
template_name = u'django/forms/widgets/select.html'
use_required_attribute(initial)

Don’t render ‘required’ if the first <option> has a value, as that’s invalid HTML.

value_from_datadict(data, files, name)[source]
value_omitted_from_data(data, files, name)