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(SmartDateTimeField, (l'From:',), {'formats': ['%Y-%m-%d %H:%M', '%Y-%m-%dT%H:%M'], 'validators': [<wtforms.validators.Optional object>]})>
dt_to = <UnboundField(SmartDateTimeField, (l'To:',), {'formats': ['%Y-%m-%d %H:%M', '%Y-%m-%dT%H:%M'], 'validators': [<wtforms.validators.Optional object>]})>
groups = <UnboundField(QuerySelectMultipleField, (l'Groups:',), {'query_factory': <function get_available_groups>, 'allow_blank': False, 'get_pk': <function EventReportSearchForm.<lambda>>})>
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.FeedbackForm(formdata=<object object>, **kwargs)[source]

Bases: flask_wtf.form.FlaskForm

Class representing feedback form for reports.

ip = <UnboundField(HiddenField, (), {'validators': [<wtforms.validators.DataRequired object>, <function check_network_record>]})>
section = <UnboundField(HiddenField, (), {'validators': [<wtforms.validators.DataRequired object>, <wtforms.validators.Length object>]})>
submit = <UnboundField(SubmitField, (l'Send feedback',), {})>
text = <UnboundField(TextAreaField, (), {'validators': [<wtforms.validators.DataRequired object>, <wtforms.validators.Length object>]})>
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(SmartDateTimeField, (l'From:',), {'default': <function ReportingDashboardForm.<lambda>>, 'validators': [<wtforms.validators.Optional object>]})>
dt_to = <UnboundField(SmartDateTimeField, (l'To:',), {'validators': [<wtforms.validators.Optional object>]})>
groups = <UnboundField(QuerySelectMultipleField, (l'Groups:',), {'query_factory': <function get_available_groups>, 'allow_blank': False, 'get_pk': <function ReportingDashboardForm.<lambda>>})>
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.