hawat.blueprints.changelogs.forms module

This module contains custom item changelog search form for Hawat.

class hawat.blueprints.changelogs.forms.ItemChangeLogDashboardForm(formdata=<object object>, **kwargs)[source]

Bases: flask_wtf.form.FlaskForm

Class representing item changelog dashboard search form.

dt_from = <UnboundField(DateTimeLocalField, (l'From:',), {'default': <function ItemChangeLogDashboardForm.<lambda>>, 'format': '%Y-%m-%d %H:%M:%S', 'validators': [<wtforms.validators.Optional object>]})>
dt_to = <UnboundField(DateTimeLocalField, (l'To:',), {'format': '%Y-%m-%d %H:%M:%S', 'validators': [<wtforms.validators.Optional object>]})>
submit = <UnboundField(SubmitField, (l'Calculate',), {})>
class hawat.blueprints.changelogs.forms.ItemChangeLogSearchForm(*args, **kwargs)[source]

Bases: hawat.forms.BaseSearchForm

Class representing item changelog search form.

authors = <UnboundField(QuerySelectMultipleField, (l'Authors:',), {'query_factory': <function get_available_authors>, 'get_label': <function ItemChangeLogSearchForm.<lambda>>})>
dt_from = <UnboundField(DateTimeLocalField, (l'From:',), {'default': <function ItemChangeLogSearchForm.<lambda>>, 'format': '%Y-%m-%d %H:%M', 'validators': [<wtforms.validators.Optional object>]})>
dt_to = <UnboundField(DateTimeLocalField, (l'To:',), {'format': '%Y-%m-%d %H:%M:%S', 'validators': [<wtforms.validators.Optional object>]})>
imodel = <UnboundField(SelectField, (l'Item model:',), {'filters': [<function ItemChangeLogSearchForm.<lambda>>], 'choices': [('', l'Nothing selected')], 'default': '', 'validators': [<wtforms.validators.Optional object>]})>
imodel_id = <UnboundField(IntegerField, (l'Model ID:',), {'validators': [<wtforms.validators.Optional object>]})>
static is_multivalue(field_name)[source]

Check, if given form field is a multivalue field.

Parameters

field_name (str) – Name of the form field.

Returns

True, if the field can contain multiple values, False otherwise.

Return type

bool

operations = <UnboundField(SelectMultipleField, (l'Operations:',), {'filters': [<function ItemChangeLogSearchForm.<lambda>>], 'validators': [<wtforms.validators.Optional object>]})>
hawat.blueprints.changelogs.forms.get_available_authors()[source]

Query the database for list of changelog authors.

hawat.blueprints.changelogs.forms.get_item_model_choices()[source]

Return select choices for item changelog item models.

hawat.blueprints.changelogs.forms.get_item_operation_choices()[source]

Return select choices for item changelog operations.