tags_input.widgets module¶
- class tags_input.widgets.AdminTagsInputWidget(verbose_name, is_stacked, attrs=None, choices=())[source]¶
Bases:
FilteredSelectMultiple
,TagsInputWidgetBase
- class Media[source]¶
Bases:
object
- css = {'all': ('jquery.tagsinput-revisited-2.0.min.css', 'jquery-ui-1.12.1.min.css')}¶
- js = ('jquery-3.2.1.min.js', 'jquery-ui-1.12.1.min.js', 'jquery.tagsinput-revisited-2.0.min.js')¶
- add_id_index = False¶
- allow_multiple_selected = True¶
- build_attrs(base_attrs, extra_attrs=None, **kwargs)¶
Compatibility function for the behavior changes in Django 1.11+
- checked_attribute = {'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='0')¶
Use an incremented id for each option where the main widget references the zero index.
- input_type = 'select'¶
- property is_hidden¶
- is_localized = False¶
- is_required = False¶
- property 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 = '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=(), renderer=None)¶
Render the widget as an HTML string.
- 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 = '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)¶
Given a dictionary of data and this widget’s name, return the value of this widget or None if it’s not provided.
- 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:
TagsInputWidgetBase
- class Media[source]¶
Bases:
object
- css = {'all': ('jquery.tagsinput-revisited-2.0.min.css', 'jquery-ui-1.12.1.min.css')}¶
- enable_jquery = True¶
- js = ('jquery-3.2.1.min.js', 'jquery-ui-1.12.1.min.js', 'jquery.tagsinput-revisited-2.0.min.js')¶
- add_id_index = False¶
- allow_multiple_selected = True¶
- build_attrs(base_attrs, extra_attrs=None, **kwargs)¶
Compatibility function for the behavior changes in Django 1.11+
- checked_attribute = {'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='0')¶
Use an incremented id for each option where the main widget references the zero index.
- input_type = 'select'¶
- property is_hidden¶
- is_localized = False¶
- is_required = False¶
- property 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 = '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=(), renderer=None)¶
Render the widget as an HTML string.
- 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 = '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)¶
Given a dictionary of data and this widget’s name, return the value of this widget or None if it’s not provided.
- 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:
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 = {'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='0')¶
Use an incremented id for each option where the main widget references the zero index.
- input_type = 'select'¶
- property is_hidden¶
- is_localized = False¶
- is_required = False¶
- property 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 = '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=(), renderer=None)[source]¶
Render the widget as an HTML string.
- 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 = '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]¶
Given a dictionary of data and this widget’s name, return the value of this widget or None if it’s not provided.
- value_omitted_from_data(data, files, name)¶