forms

class siruta.forms.CountyField(**kwargs)[source]

An integer field with choices.

__init__(**kwargs)[source]
class siruta.forms.LocalityField(*, county_field='county', **kwargs)[source]

An integer field with choices.

The default widget dynamically changes choices depending on another form field named "county". Override county_field to change this.

Values are ordered by type. See siruta.cli.SIRUTA_TYPE_REORDER for exact precedence.

__init__(*, county_field='county', **kwargs)[source]
to_python(value)[source]
class siruta.forms.LocalityWidget(*, county_field)[source]
__init__(*, county_field)[source]
format_value(value)[source]

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

get_context(name, value, attrs)[source]
property media
template_name = 'siruta/locality.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 siruta.forms.SelectizeSelectWidget(attrs=None, choices=())[source]
property media
template_name = 'siruta/selectize_select.html'