Indico fields

Todo

Docstrings to all fields

Indico fields extend from WTForm fields and are used for the special cases where the simple form fields are not enough to cover all needs.

class indico.modules.events.fields.EventPersonLinkListField(*args, **kwargs)

Bases: indico.modules.events.fields.PersonLinkListFieldBase

A field to manage event’s chairpersons.

linked_object_attr = u'event'

alias of indico.modules.events.models.persons.EventPersonLink

pre_validate(form)
widget = <indico.web.forms.widgets.JinjaWidget object>
class indico.modules.events.fields.EventPersonListField(*args, **kwargs)

Bases: indico.web.forms.fields.principals.PrincipalListField

A field that lets you select a list Indico user and EventPersons.

This requires its form to have an event set.

create_untrusted_persons = False

Whether new event persons created by the field should be marked as untrusted

event
process_formdata(valuelist)
class indico.modules.events.fields.IndicoThemeSelectField(*args, **kwargs)

Bases: wtforms.fields.core.SelectField

class indico.modules.events.fields.PersonLinkListFieldBase(*args, **kwargs)

Bases: indico.modules.events.fields.EventPersonListField

default_sort_alpha = True

If set to True, will be sorted alphabetically by default

linked_object_attr = None

name of the attribute on the form containing the linked object

class that inherits from PersonLinkBase

widget = None
class indico.modules.events.fields.RatingReviewField(*args, **kwargs)

Bases: wtforms.fields.core.RadioField

widget = <indico.web.forms.widgets.JinjaWidget object>
class indico.modules.events.fields.ReferencesField(*args, **kwargs)

Bases: indico.web.forms.fields.itemlists.MultipleItemsField

A field to manage external references.

pre_validate(form)
process_formdata(valuelist)
class indico.modules.events.abstracts.fields.AbstractField(*args, **kwargs)

Bases: wtforms.ext.sqlalchemy.fields.QuerySelectField

A selectize-based field to select an abstract from an event.

event
pre_validate(form)
search_payload
search_url
widget = <indico.web.forms.widgets.SelectizeWidget object>
class indico.modules.events.abstracts.fields.AbstractPersonLinkListField(*args, **kwargs)

Bases: indico.modules.events.fields.PersonLinkListFieldBase

A field to configure a list of abstract persons.

create_untrusted_persons = True
default_sort_alpha = False
linked_object_attr = u'abstract'

alias of indico.modules.events.abstracts.models.persons.AbstractPersonLink

pre_validate(form)
widget = <indico.web.forms.widgets.JinjaWidget object>
class indico.modules.events.abstracts.fields.EmailRuleListField(label=None, validators=None, filters=(), description=u'', id=None, default=None, widget=None, render_kw=None, _form=None, _name=None, _prefix=u'', _translations=None, _meta=None)

Bases: indico.web.forms.fields.simple.JSONField

A field that stores a list of e-mail template rules.

Construct a new field.

Parameters:
  • label – The label of the field.
  • validators – A sequence of validators to call when validate is called.
  • filters – A sequence of filters which are run on input data by process.
  • description – A description for the field, typically used for help text.
  • id – An id to use for the field. A reasonable default is set by the form, and you shouldn’t need to set this manually.
  • default – The default value to assign to the field, if no form or object input is provided. May be a callable.
  • widget – If provided, overrides the widget used to render the field.
  • render_kw (dict) – If provided, a dictionary which provides default keywords that will be given to the widget at render time.
  • _form – The form holding this field. It is passed by the form itself during construction. You should never pass this value yourself.
  • _name – The name of this field, passed by the enclosing form during its construction. You should never pass this value yourself.
  • _prefix – The prefix to prepend to the form name of this field, passed by the enclosing form during construction.
  • _translations – A translations object providing message translations. Usually passed by the enclosing form during construction. See I18n docs for information on message translations.
  • _meta – If provided, this is the ‘meta’ instance from the form. You usually don’t pass this yourself.

If _form and _name isn’t provided, an UnboundField will be returned instead. Call its bind() method with a form instance and a name to construct the field.

CAN_POPULATE = True
accepted_condition_types = (<class 'indico.modules.events.abstracts.notifications.StateCondition'>, <class 'indico.modules.events.abstracts.notifications.TrackCondition'>, <class 'indico.modules.events.abstracts.notifications.ContributionTypeCondition'>)
condition_choices
condition_class_map = {u'contribution_type': <class 'indico.modules.events.abstracts.notifications.ContributionTypeCondition'>, u'state': <class 'indico.modules.events.abstracts.notifications.StateCondition'>, u'track': <class 'indico.modules.events.abstracts.notifications.TrackCondition'>}
pre_validate(form)
widget = <indico.web.forms.widgets.JinjaWidget object>
class indico.modules.events.abstracts.fields.TrackRoleField(label=None, validators=None, filters=(), description=u'', id=None, default=None, widget=None, render_kw=None, _form=None, _name=None, _prefix=u'', _translations=None, _meta=None)

Bases: indico.web.forms.fields.simple.JSONField

A field to assign track roles to principals.

Construct a new field.

Parameters:
  • label – The label of the field.
  • validators – A sequence of validators to call when validate is called.
  • filters – A sequence of filters which are run on input data by process.
  • description – A description for the field, typically used for help text.
  • id – An id to use for the field. A reasonable default is set by the form, and you shouldn’t need to set this manually.
  • default – The default value to assign to the field, if no form or object input is provided. May be a callable.
  • widget – If provided, overrides the widget used to render the field.
  • render_kw (dict) – If provided, a dictionary which provides default keywords that will be given to the widget at render time.
  • _form – The form holding this field. It is passed by the form itself during construction. You should never pass this value yourself.
  • _name – The name of this field, passed by the enclosing form during its construction. You should never pass this value yourself.
  • _prefix – The prefix to prepend to the form name of this field, passed by the enclosing form during construction.
  • _translations – A translations object providing message translations. Usually passed by the enclosing form during construction. See I18n docs for information on message translations.
  • _meta – If provided, this is the ‘meta’ instance from the form. You usually don’t pass this yourself.

If _form and _name isn’t provided, an UnboundField will be returned instead. Call its bind() method with a form instance and a name to construct the field.

CAN_POPULATE = True
category_roles
event_roles
permissions_info
widget = <indico.web.forms.widgets.JinjaWidget object>
class indico.modules.events.contributions.fields.ContributionPersonLinkListField(*args, **kwargs)

Bases: indico.modules.events.fields.PersonLinkListFieldBase

A field to configure a list of contribution persons.

linked_object_attr = u'contrib'

alias of indico.modules.events.contributions.models.persons.ContributionPersonLink

pre_validate(form)
widget = <indico.web.forms.widgets.JinjaWidget object>
class indico.modules.events.contributions.fields.SubContributionPersonLinkListField(*args, **kwargs)

Bases: indico.modules.events.contributions.fields.ContributionPersonLinkListField

A field to configure a list of subcontribution persons.

linked_object_attr = u'subcontrib'

alias of indico.modules.events.contributions.models.persons.SubContributionPersonLink

widget = <indico.web.forms.widgets.JinjaWidget object>
class indico.modules.events.papers.fields.PaperEmailSettingsField(label=None, validators=None, filters=(), description=u'', id=None, default=None, widget=None, render_kw=None, _form=None, _name=None, _prefix=u'', _translations=None, _meta=None)

Bases: indico.web.forms.fields.simple.JSONField

Construct a new field.

Parameters:
  • label – The label of the field.
  • validators – A sequence of validators to call when validate is called.
  • filters – A sequence of filters which are run on input data by process.
  • description – A description for the field, typically used for help text.
  • id – An id to use for the field. A reasonable default is set by the form, and you shouldn’t need to set this manually.
  • default – The default value to assign to the field, if no form or object input is provided. May be a callable.
  • widget – If provided, overrides the widget used to render the field.
  • render_kw (dict) – If provided, a dictionary which provides default keywords that will be given to the widget at render time.
  • _form – The form holding this field. It is passed by the form itself during construction. You should never pass this value yourself.
  • _name – The name of this field, passed by the enclosing form during its construction. You should never pass this value yourself.
  • _prefix – The prefix to prepend to the form name of this field, passed by the enclosing form during construction.
  • _translations – A translations object providing message translations. Usually passed by the enclosing form during construction. See I18n docs for information on message translations.
  • _meta – If provided, this is the ‘meta’ instance from the form. You usually don’t pass this yourself.

If _form and _name isn’t provided, an UnboundField will be returned instead. Call its bind() method with a form instance and a name to construct the field.

CAN_POPULATE = True
event
process_formdata(valuelist)
widget = <indico.web.forms.widgets.JinjaWidget object>
class indico.modules.events.sessions.fields.SessionBlockPersonLinkListField(*args, **kwargs)

Bases: indico.modules.events.fields.PersonLinkListFieldBase

linked_object_attr = u'session_block'

alias of indico.modules.events.sessions.models.persons.SessionBlockPersonLink

widget = <indico.web.forms.widgets.JinjaWidget object>
class indico.modules.categories.fields.CategoryField(*args, **kwargs)

Bases: wtforms.fields.simple.HiddenField

WTForms field that lets you select a category.

Parameters:
  • allow_events – Whether to allow selecting a category that contains events.
  • allow_subcats – Whether to allow selecting a category that contains subcategories.
  • require_event_creation_rights – Whether to allow selecting only categories where the user can create events.
pre_validate(form)
process_data(value)
process_formdata(valuelist)
widget = <indico.web.forms.widgets.JinjaWidget object>
class indico.modules.networks.fields.MultiIPNetworkField(*args, **kwargs)

Bases: indico.web.forms.fields.itemlists.MultiStringField

A field to enter multiple IPv4 or IPv6 networks.

The field data is a set of IPNetwork``s not bound to a DB session. The ``unique and sortable parameters of the parent class cannot be used with this class.

pre_validate(form)
process_data(value)
process_formdata(valuelist)
class indico.web.forms.fields.IndicoSelectMultipleCheckboxField(label=None, validators=None, coerce=<type 'unicode'>, choices=None, validate_choice=True, **kwargs)

Bases: wtforms.fields.core.SelectMultipleField

option_widget = <wtforms.widgets.core.CheckboxInput object>
widget = <indico.web.forms.widgets.JinjaWidget object>
class indico.web.forms.fields.IndicoRadioField(*args, **kwargs)

Bases: wtforms.fields.core.RadioField

widget = <indico.web.forms.widgets.JinjaWidget object>
class indico.web.forms.fields.JSONField(label=None, validators=None, filters=(), description=u'', id=None, default=None, widget=None, render_kw=None, _form=None, _name=None, _prefix=u'', _translations=None, _meta=None)

Bases: wtforms.fields.simple.HiddenField

Construct a new field.

Parameters:
  • label – The label of the field.
  • validators – A sequence of validators to call when validate is called.
  • filters – A sequence of filters which are run on input data by process.
  • description – A description for the field, typically used for help text.
  • id – An id to use for the field. A reasonable default is set by the form, and you shouldn’t need to set this manually.
  • default – The default value to assign to the field, if no form or object input is provided. May be a callable.
  • widget – If provided, overrides the widget used to render the field.
  • render_kw (dict) – If provided, a dictionary which provides default keywords that will be given to the widget at render time.
  • _form – The form holding this field. It is passed by the form itself during construction. You should never pass this value yourself.
  • _name – The name of this field, passed by the enclosing form during its construction. You should never pass this value yourself.
  • _prefix – The prefix to prepend to the form name of this field, passed by the enclosing form during construction.
  • _translations – A translations object providing message translations. Usually passed by the enclosing form during construction. See I18n docs for information on message translations.
  • _meta – If provided, this is the ‘meta’ instance from the form. You usually don’t pass this yourself.

If _form and _name isn’t provided, an UnboundField will be returned instead. Call its bind() method with a form instance and a name to construct the field.

CAN_POPULATE = False

Whether an object may be populated with the data from this field

populate_obj(obj, name)
process_formdata(valuelist)
class indico.web.forms.fields.HiddenFieldList(label=None, validators=None, filters=(), description=u'', id=None, default=None, widget=None, render_kw=None, _form=None, _name=None, _prefix=u'', _translations=None, _meta=None)

Bases: wtforms.fields.simple.HiddenField

A hidden field that handles lists of strings.

This is done getlist-style, i.e. by repeating the input element with the same name for each list item.

The only case where this field is useful is when you display a form via POST and provide a list of items (e.g. ids) related to the form which needs to be kept when the form is submitted and also need to access it via request.form.getlist(...) before submitting the form.

Construct a new field.

Parameters:
  • label – The label of the field.
  • validators – A sequence of validators to call when validate is called.
  • filters – A sequence of filters which are run on input data by process.
  • description – A description for the field, typically used for help text.
  • id – An id to use for the field. A reasonable default is set by the form, and you shouldn’t need to set this manually.
  • default – The default value to assign to the field, if no form or object input is provided. May be a callable.
  • widget – If provided, overrides the widget used to render the field.
  • render_kw (dict) – If provided, a dictionary which provides default keywords that will be given to the widget at render time.
  • _form – The form holding this field. It is passed by the form itself during construction. You should never pass this value yourself.
  • _name – The name of this field, passed by the enclosing form during its construction. You should never pass this value yourself.
  • _prefix – The prefix to prepend to the form name of this field, passed by the enclosing form during construction.
  • _translations – A translations object providing message translations. Usually passed by the enclosing form during construction. See I18n docs for information on message translations.
  • _meta – If provided, this is the ‘meta’ instance from the form. You usually don’t pass this yourself.

If _form and _name isn’t provided, an UnboundField will be returned instead. Call its bind() method with a form instance and a name to construct the field.

process_formdata(valuelist)
widget = <indico.web.forms.widgets.HiddenInputs object>
class indico.web.forms.fields.TextListField(label=None, validators=None, filters=(), description=u'', id=None, default=None, widget=None, render_kw=None, _form=None, _name=None, _prefix=u'', _translations=None, _meta=None)

Bases: wtforms.fields.simple.TextAreaField

Construct a new field.

Parameters:
  • label – The label of the field.
  • validators – A sequence of validators to call when validate is called.
  • filters – A sequence of filters which are run on input data by process.
  • description – A description for the field, typically used for help text.
  • id – An id to use for the field. A reasonable default is set by the form, and you shouldn’t need to set this manually.
  • default – The default value to assign to the field, if no form or object input is provided. May be a callable.
  • widget – If provided, overrides the widget used to render the field.
  • render_kw (dict) – If provided, a dictionary which provides default keywords that will be given to the widget at render time.
  • _form – The form holding this field. It is passed by the form itself during construction. You should never pass this value yourself.
  • _name – The name of this field, passed by the enclosing form during its construction. You should never pass this value yourself.
  • _prefix – The prefix to prepend to the form name of this field, passed by the enclosing form during construction.
  • _translations – A translations object providing message translations. Usually passed by the enclosing form during construction. See I18n docs for information on message translations.
  • _meta – If provided, this is the ‘meta’ instance from the form. You usually don’t pass this yourself.

If _form and _name isn’t provided, an UnboundField will be returned instead. Call its bind() method with a form instance and a name to construct the field.

pre_validate(form)
process_formdata(valuelist)
class indico.web.forms.fields.EmailListField(label=None, validators=None, filters=(), description=u'', id=None, default=None, widget=None, render_kw=None, _form=None, _name=None, _prefix=u'', _translations=None, _meta=None)

Bases: indico.web.forms.fields.simple.TextListField

Construct a new field.

Parameters:
  • label – The label of the field.
  • validators – A sequence of validators to call when validate is called.
  • filters – A sequence of filters which are run on input data by process.
  • description – A description for the field, typically used for help text.
  • id – An id to use for the field. A reasonable default is set by the form, and you shouldn’t need to set this manually.
  • default – The default value to assign to the field, if no form or object input is provided. May be a callable.
  • widget – If provided, overrides the widget used to render the field.
  • render_kw (dict) – If provided, a dictionary which provides default keywords that will be given to the widget at render time.
  • _form – The form holding this field. It is passed by the form itself during construction. You should never pass this value yourself.
  • _name – The name of this field, passed by the enclosing form during its construction. You should never pass this value yourself.
  • _prefix – The prefix to prepend to the form name of this field, passed by the enclosing form during construction.
  • _translations – A translations object providing message translations. Usually passed by the enclosing form during construction. See I18n docs for information on message translations.
  • _meta – If provided, this is the ‘meta’ instance from the form. You usually don’t pass this yourself.

If _form and _name isn’t provided, an UnboundField will be returned instead. Call its bind() method with a form instance and a name to construct the field.

process_formdata(valuelist)
class indico.web.forms.fields.IndicoPasswordField(*args, **kwargs)

Bases: wtforms.fields.simple.PasswordField

Password field which can show or hide the password.

widget = <indico.web.forms.widgets.PasswordWidget object>
class indico.web.forms.fields.IndicoStaticTextField(*args, **kwargs)

Bases: wtforms.fields.core.Field

Return an html element with text taken from this field’s value.

process_data(data)
widget = <indico.web.forms.widgets.JinjaWidget object>
class indico.web.forms.fields.IndicoTagListField(label=None, validators=None, filters=(), description=u'', id=None, default=None, widget=None, render_kw=None, _form=None, _name=None, _prefix=u'', _translations=None, _meta=None)

Bases: indico.web.forms.fields.simple.HiddenFieldList

Construct a new field.

Parameters:
  • label – The label of the field.
  • validators – A sequence of validators to call when validate is called.
  • filters – A sequence of filters which are run on input data by process.
  • description – A description for the field, typically used for help text.
  • id – An id to use for the field. A reasonable default is set by the form, and you shouldn’t need to set this manually.
  • default – The default value to assign to the field, if no form or object input is provided. May be a callable.
  • widget – If provided, overrides the widget used to render the field.
  • render_kw (dict) – If provided, a dictionary which provides default keywords that will be given to the widget at render time.
  • _form – The form holding this field. It is passed by the form itself during construction. You should never pass this value yourself.
  • _name – The name of this field, passed by the enclosing form during its construction. You should never pass this value yourself.
  • _prefix – The prefix to prepend to the form name of this field, passed by the enclosing form during construction.
  • _translations – A translations object providing message translations. Usually passed by the enclosing form during construction. See I18n docs for information on message translations.
  • _meta – If provided, this is the ‘meta’ instance from the form. You usually don’t pass this yourself.

If _form and _name isn’t provided, an UnboundField will be returned instead. Call its bind() method with a form instance and a name to construct the field.

widget = <indico.web.forms.widgets.JinjaWidget object>
class indico.web.forms.fields.IndicoPalettePickerField(*args, **kwargs)

Bases: indico.web.forms.fields.simple.JSONField

Field allowing user to pick a color from a set of predefined values.

CAN_POPULATE = True
pre_validate(form)
process_data(value)
process_formdata(valuelist)
widget = <indico.web.forms.widgets.JinjaWidget object>
class indico.web.forms.fields.IndicoSinglePalettePickerField(*args, **kwargs)

Bases: indico.web.forms.fields.colors.IndicoPalettePickerField

Like IndicoPalettePickerField but for just a single color.

pre_validate(form)
process_formdata(valuelist)
class indico.web.forms.fields.TimeDeltaField(*args, **kwargs)

Bases: wtforms.fields.core.Field

A field that lets the user select a simple timedelta.

It does not support mixing multiple units, but it is smart enough to switch to a different unit to represent a timedelta that could not be represented otherwise.

Parameters:units – The available units. Must be a tuple containing any any of ‘seconds’, ‘minutes’, ‘hours’ and ‘days’. If not specified, ('hours', 'days') is assumed.
best_unit

Return the largest unit that covers the current timedelta.

choices
magnitudes = {u'days': 86400, u'hours': 3600, u'minutes': 60, u'seconds': 1}
pre_validate(form)
process_formdata(valuelist)
unit_names = {u'days': u'Days', u'hours': u'Hours', u'minutes': u'Minutes', u'seconds': u'Seconds'}
widget = <indico.web.forms.widgets.JinjaWidget object>
class indico.web.forms.fields.IndicoDateTimeField(*args, **kwargs)

Bases: wtforms.ext.dateutil.fields.DateTimeField

Friendly datetime field that handles timezones and validations.

Important: When the form has a timezone field it must be declared before any IndicoDateTimeField. Otherwise its value is not available in this field resulting in an error during form submission.

earliest_dt
latest_dt
linked_datetime_validator
linked_field
pre_validate(form)
process_formdata(valuelist)
timezone
timezone_field
tzinfo
widget = <indico.web.forms.widgets.JinjaWidget object>
class indico.web.forms.fields.OccurrencesField(*args, **kwargs)

Bases: indico.web.forms.fields.simple.JSONField

A field that lets you select multiple occurrences consisting of a start date/time and a duration.

CAN_POPULATE = True
process_formdata(valuelist)
timezone
timezone_field
widget = <indico.web.forms.widgets.JinjaWidget object>
class indico.web.forms.fields.IndicoTimezoneSelectField(*args, **kwargs)

Bases: wtforms.fields.core.SelectField

process_data(value)
class indico.web.forms.fields.IndicoEnumSelectField(label=None, validators=None, enum=None, sorted=False, only=None, skip=None, none=None, titles=None, keep_enum=True, **kwargs)

Bases: indico.web.forms.fields.enums._EnumFieldMixin, wtforms.fields.core.SelectFieldBase

Select field backed by a RichEnum.

iter_choices()
widget = <wtforms.widgets.core.Select object>
class indico.web.forms.fields.IndicoEnumRadioField(label=None, validators=None, enum=None, sorted=False, only=None, skip=None, none=None, titles=None, keep_enum=True, **kwargs)

Bases: indico.web.forms.fields.enums.IndicoEnumSelectField

option_widget = <wtforms.widgets.core.RadioInput object>
widget = <indico.web.forms.widgets.JinjaWidget object>
class indico.web.forms.fields.HiddenEnumField(label=None, validators=None, enum=None, only=None, skip=None, none=None, **kwargs)

Bases: indico.web.forms.fields.enums._EnumFieldMixin, wtforms.fields.simple.HiddenField

Hidden field that only accepts values from an Enum.

process_formdata(valuelist)
class indico.web.forms.fields.FileField(*args, **kwargs)

Bases: wtforms.fields.core.Field

A dropzone field.

default_options = {u'add_remove_links': True, u'handle_flashes': False, u'lightweight': False, u'max_files': 10, u'multiple_files': False}
process_formdata(valuelist)
widget = <indico.web.forms.widgets.JinjaWidget object>
class indico.web.forms.fields.MultiStringField(*args, **kwargs)

Bases: wtforms.fields.simple.HiddenField

A field with multiple input text fields.

Parameters:
  • field – A tuple (fieldname, title) where the title is used in the placeholder.
  • uuid_field – If set, each item will have a UUID assigned and stored in the field specified here.
  • flat – If True, the field returns a list of string values instead of dicts. Cannot be combined with uuid_field.
  • unique – Whether the values should be unique.
  • sortable – Whether items should be sortable.
pre_validate(form)
process_formdata(valuelist)
widget = <indico.web.forms.widgets.JinjaWidget object>
class indico.web.forms.fields.MultipleItemsField(*args, **kwargs)

Bases: wtforms.fields.simple.HiddenField

A field with multiple items consisting of multiple string values.

Parameters:
  • fields

    A list of dicts with the following arguments: ‘id’: the unique ID of the field ‘caption’: the title of the column and the placeholder ‘type’: ‘text|number|select’, the type of the field ‘coerce’: callable to convert the value to a python type.

    the type must be comvertible back to a string, so usually you just want something like int or float here.

    In case the type is ‘select’, the property ‘choices’ of the MultipleItemsField or the ‘choices’ kwarg needs to be a dict where the key is the ‘id’ of the select field and the value is another dict mapping the option’s id to it caption.

  • uuid_field – If set, each item will have a UUID assigned and stored in the field specified here. The name specified here may not be in fields.
  • uuid_field_opaque – If set, the uuid_field is considered opaque, i.e. it is never touched by this field. This is useful when you subclass the field and use e.g. actual database IDs instead of UUIDs.
  • unique_field – The name of a field in fields that needs to be unique.
  • sortable – Whether items should be sortable.
pre_validate(form)
process_formdata(valuelist)
widget = <indico.web.forms.widgets.JinjaWidget object>
class indico.web.forms.fields.OverrideMultipleItemsField(*args, **kwargs)

Bases: wtforms.fields.simple.HiddenField

A field similar to MultipleItemsField which allows the user to override some values.

Parameters:
  • fields – a list of (fieldname, title) tuples. Should match the fields of the corresponding MultipleItemsField.
  • field_data – the data from the corresponding MultipleItemsField.
  • unique_field – the name of the field which is unique among all rows
  • edit_fields – a set containing the field names which can be edited

If you decide to use this field, please consider adding support for uuid_field here!

get_overridden_value(row, name)

Utility for the widget to get the entered value for an editable field.

get_row_key(row)

Utility for the widget to get the unique value for a row.

pre_validate(form)
process_formdata(valuelist)
widget = <indico.web.forms.widgets.JinjaWidget object>
class indico.web.forms.fields.PrincipalListField(*args, **kwargs)

Bases: wtforms.fields.simple.HiddenField

A field that lets you select a list of principals.

Principals are users or other objects represending users such as groups or roles that can be added to ACLs.

Parameters:
  • allow_external_users – If “search users with no indico account” should be available. Selecting such a user will automatically create a pending user once the form is submitted, even if other fields in the form fail to validate!
  • allow_groups – If groups should be selectable.
  • allow_event_roles – If event roles should be selectable.
  • allow_category_roles – If category roles should be selectable.
  • allow_registration_forms – If registration form associated to an event should be selectable.
  • allow_emails – If the field should allow bare emails. Those are not selectable in the widget, but may be added to an ACL through other means.
process_formdata(valuelist)
widget = <indico.web.forms.widgets.JinjaWidget object>
class indico.web.forms.fields.PrincipalField(*args, **kwargs)

Bases: wtforms.fields.simple.HiddenField

A field that lets you select a single Indico user.

Parameters:allow_external_users – If “search users with no indico account” should be available. Selecting such a user will automatically create a pending user once the form is submitted, even if other fields in the form fail to validate!
process_formdata(valuelist)
widget = <indico.web.forms.widgets.JinjaWidget object>
class indico.web.forms.fields.AccessControlListField(*args, **kwargs)

Bases: indico.web.forms.fields.principals.PrincipalListField

class indico.web.forms.fields.IndicoQuerySelectMultipleField(*args, **kwargs)

Bases: wtforms.ext.sqlalchemy.fields.QuerySelectMultipleField

Like the parent, but with a callback that allows you to modify the list

The callback can return a new list or yield items, and you can use it e.g. to sort the list.

data
class indico.web.forms.fields.EditableFileField(*args, **kwargs)

Bases: indico.web.forms.fields.files.FileField

A dropzone field that displays its current state and keeps track of deletes.

process_formdata(valuelist)
widget = <indico.web.forms.widgets.JinjaWidget object>
class indico.web.forms.fields.IndicoQuerySelectMultipleCheckboxField(*args, **kwargs)

Bases: indico.web.forms.fields.sqlalchemy.IndicoQuerySelectMultipleField

option_widget = <wtforms.widgets.core.CheckboxInput object>
widget = <indico.web.forms.widgets.JinjaWidget object>
class indico.web.forms.fields.IndicoLocationField(*args, **kwargs)

Bases: indico.web.forms.fields.simple.JSONField

CAN_POPULATE = True
process_formdata(valuelist)
widget = <indico.web.forms.widgets.LocationWidget object>
class indico.web.forms.fields.IndicoMarkdownField(*args, **kwargs)

Bases: wtforms.fields.simple.TextAreaField

A Markdown-enhanced textarea.

When using the editor you need to include the markdown JS/CSS bundles and also the MathJax JS bundle (even when using only the editor without Mathjax).

Parameters:
  • editor – Whether to use the WMD widget with its live preview
  • mathjax – Whether to use MathJax in the WMD live preview
widget = <indico.web.forms.widgets.JinjaWidget object>
class indico.web.forms.fields.IndicoDateField(*args, **kwargs)

Bases: wtforms.ext.dateutil.fields.DateField

earliest_date
latest_date
linked_date_validator
linked_field
widget = <indico.web.forms.widgets.JinjaWidget object>
class indico.web.forms.fields.IndicoProtectionField(*args, **kwargs)

Bases: indico.web.forms.fields.enums.IndicoEnumRadioField

radio_widget = <indico.web.forms.widgets.JinjaWidget object>
render_protection_message()
widget = <indico.web.forms.widgets.JinjaWidget object>
class indico.web.forms.fields.IndicoSelectMultipleCheckboxBooleanField(label=None, validators=None, coerce=<type 'unicode'>, choices=None, validate_choice=True, **kwargs)

Bases: indico.web.forms.fields.simple.IndicoSelectMultipleCheckboxField

iter_choices()
process_formdata(valuelist)
class indico.web.forms.fields.RelativeDeltaField(*args, **kwargs)

Bases: wtforms.fields.core.Field

A field that lets the user select a simple timedelta.

It does not support mixing multiple units, but it is smart enough to switch to a different unit to represent a timedelta that could not be represented otherwise.

Parameters:units – The available units. Must be a tuple containing any any of ‘seconds’, ‘minutes’, ‘hours’ and ‘days’. If not specified, ('hours', 'days') is assumed.
choices
magnitudes = {u'days': relativedelta(days=+1), u'hours': relativedelta(hours=+1), u'minutes': relativedelta(minutes=+1), u'months': relativedelta(months=+1), u'seconds': relativedelta(seconds=+1), u'weeks': relativedelta(days=+7), u'years': relativedelta(years=+1)}
pre_validate(form)
process_formdata(valuelist)
split_data
unit_names = {u'days': u'Days', u'hours': u'Hours', u'minutes': u'Minutes', u'months': u'Months', u'seconds': u'Seconds', u'weeks': u'Weeks', u'years': u'Years'}
widget = <indico.web.forms.widgets.JinjaWidget object>
class indico.web.forms.fields.IndicoWeekDayRepetitionField(*args, **kwargs)

Bases: wtforms.fields.core.Field

Field that lets you select an ordinal day of the week.

WEEK_DAY_NUMBER_CHOICES = ((1, lu'first'), (2, lu'second'), (3, lu'third'), (4, lu'fourth'), (-1, lu'last'))
day_number_data
process_formdata(valuelist)
week_day_data
widget = <indico.web.forms.widgets.JinjaWidget object>
class indico.web.forms.fields.IndicoEmailRecipientsField(label=None, validators=None, filters=(), description=u'', id=None, default=None, widget=None, render_kw=None, _form=None, _name=None, _prefix=u'', _translations=None, _meta=None)

Bases: wtforms.fields.core.Field

Construct a new field.

Parameters:
  • label – The label of the field.
  • validators – A sequence of validators to call when validate is called.
  • filters – A sequence of filters which are run on input data by process.
  • description – A description for the field, typically used for help text.
  • id – An id to use for the field. A reasonable default is set by the form, and you shouldn’t need to set this manually.
  • default – The default value to assign to the field, if no form or object input is provided. May be a callable.
  • widget – If provided, overrides the widget used to render the field.
  • render_kw (dict) – If provided, a dictionary which provides default keywords that will be given to the widget at render time.
  • _form – The form holding this field. It is passed by the form itself during construction. You should never pass this value yourself.
  • _name – The name of this field, passed by the enclosing form during its construction. You should never pass this value yourself.
  • _prefix – The prefix to prepend to the form name of this field, passed by the enclosing form during construction.
  • _translations – A translations object providing message translations. Usually passed by the enclosing form during construction. See I18n docs for information on message translations.
  • _meta – If provided, this is the ‘meta’ instance from the form. You usually don’t pass this yourself.

If _form and _name isn’t provided, an UnboundField will be returned instead. Call its bind() method with a form instance and a name to construct the field.

process_data(data)
widget = <indico.web.forms.widgets.JinjaWidget object>
class indico.web.forms.fields.IndicoTimeField(label=None, validators=None, format=u'%H:%M', **kwargs)

Bases: wtforms.fields.core.TimeField

widget = <indico.web.forms.widgets.JinjaWidget object>