hawat.blueprints.reports.forms module

This module contains custom event report search form for Hawat.

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

Bases: hawat.forms.BaseSearchForm

Class representing event report search form.

dt_from = <UnboundField(DateTimeLocalField, (l'From:',), {'default': <function EventReportSearchForm.<lambda>>, 'validators': [<wtforms.validators.Optional object>], 'format': '%Y-%m-%d %H:%M'})>
dt_to = <UnboundField(DateTimeLocalField, (l'To:',), {'validators': [<wtforms.validators.Optional object>], 'format': '%Y-%m-%d %H:%M'})>
groups = <UnboundField(QuerySelectMultipleField, (l'Groups:',), {'get_pk': <function EventReportSearchForm.<lambda>>, 'allow_blank': False, 'query_factory': <function get_available_groups>})>
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

label = <UnboundField(StringField, (l'Label:',), {'validators': [<wtforms.validators.Optional object>]})>
severities = <UnboundField(SelectMultipleField, (l'Severities:',), {'choices': [('low', l'low'), ('medium', l'medium'), ('high', l'high'), ('critical', l'critical')], 'validators': [<wtforms.validators.Optional object>], 'filters': [<function EventReportSearchForm.<lambda>>]})>
types = <UnboundField(SelectMultipleField, (l'Types:',), {'choices': [('summary', l'summary'), ('extra', l'extra')], 'validators': [<wtforms.validators.Optional object>], 'filters': [<function EventReportSearchForm.<lambda>>]})>
class hawat.blueprints.reports.forms.ReportingDashboardForm(formdata=<object object>, **kwargs)[source]

Bases: flask_wtf.form.FlaskForm

Class representing event reporting dashboard search form.

dt_from = <UnboundField(DateTimeLocalField, (l'From:',), {'default': <function ReportingDashboardForm.<lambda>>, 'validators': [<wtforms.validators.Optional object>], 'format': '%Y-%m-%d %H:%M:%S'})>
dt_to = <UnboundField(DateTimeLocalField, (l'To:',), {'validators': [<wtforms.validators.Optional object>], 'format': '%Y-%m-%d %H:%M:%S'})>
groups = <UnboundField(QuerySelectMultipleField, (l'Groups:',), {'get_pk': <function ReportingDashboardForm.<lambda>>, 'allow_blank': False, 'query_factory': <function get_available_groups>})>
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

submit = <UnboundField(SubmitField, (l'Search',), {})>
hawat.blueprints.reports.forms.get_available_groups()[source]

Query the database for list of all available groups.

hawat.blueprints.reports.forms.get_severity_choices()[source]

Return select choices for report severities.

hawat.blueprints.reports.forms.get_type_choices()[source]

Return select choices for report severities.