hawat.blueprints.detectors.forms module

This module contains custom detector management forms for Hawat.

class hawat.blueprints.detectors.forms.AdminCreateDetectorForm(*args, **kwargs)[source]

Bases: BaseDetectorForm

Class representing detector record create form.

name = <UnboundField(StringField, (l'Name:',), {'validators': [<wtforms.validators.DataRequired object>, <wtforms.validators.Length object>, <function check_null_character>, <function check_name_uniqueness>]})>
class hawat.blueprints.detectors.forms.AdminUpdateDetectorForm(*args, **kwargs)[source]

Bases: BaseDetectorForm

Class representing detector record create form.

name = <UnboundField(StringField, (l'Name:',), {'validators': [<wtforms.validators.DataRequired object>, <wtforms.validators.Length object>, <function check_null_character>, <function check_name_uniqueness>]})>
class hawat.blueprints.detectors.forms.BaseDetectorForm(*args, **kwargs)[source]

Bases: BaseItemForm

Class representing base detector record form.

cancel = <UnboundField(SubmitField, (l'Cancel',), {})>
credibility = <UnboundField(FloatField, (l'Credibility:',), {'default': 1.0, 'validators': [<wtforms.validators.NumberRange object>]})>
description = <UnboundField(TextAreaField, (l'Description:',), {})>
source = <UnboundField(HiddenField, (), {'default': 'manual', 'validators': [<wtforms.validators.DataRequired object>, <wtforms.validators.Length object>]})>
submit = <UnboundField(SubmitField, (l'Submit',), {})>
class hawat.blueprints.detectors.forms.DetectorSearchForm(*args, **kwargs)[source]

Bases: BaseSearchForm

Class representing simple user search form.

dt_from = <UnboundField(SmartDateTimeField, (l'Creation time from:',), {'validators': [<wtforms.validators.Optional object>], 'description': l'Lower time boundary for item creation time. Timestamp is expected to be in the format <code>YYYY-MM-DD hh:mm:ss</code> and in the timezone according to the user`s preferences.'})>
dt_to = <UnboundField(SmartDateTimeField, (l'Creation time to:',), {'validators': [<wtforms.validators.Optional object>], 'description': l'Upper time boundary for item creation time. Timestamp is expected to be in the format <code>YYYY-MM-DD hh:mm:ss</code> and in the timezone according to the user`s preferences.'})>
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

search = <UnboundField(StringField, (l'Name, description:',), {'validators': [<wtforms.validators.Optional object>, <wtforms.validators.Length object>, <function check_null_character>], 'filters': [<function DetectorSearchForm.<lambda>>, <method 'strip' of 'str' objects>], 'description': l'Detector`s name or description. Search is performed even in the middle of the strings.'})>
sortby = <UnboundField(SelectField, (l'Sort by:',), {'validators': [<wtforms.validators.Optional object>], 'choices': [('createtime.desc', l'by creation time descending'), ('createtime.asc', l'by creation time ascending'), ('name.desc', l'by name descending'), ('name.asc', l'by name ascending'), ('hits.desc', l'by number of hits descending'), ('hits.asc', l'by number of hits ascending'), ('credibility.asc', l'by credibility ascending'), ('credibility.desc', l'by credibility descending')], 'default': 'name.asc'})>
source = <UnboundField(SelectField, (l'Record source:',), {'validators': [<wtforms.validators.Optional object>], 'default': ''})>
hawat.blueprints.detectors.forms.check_name_uniqueness(form, field)[source]

Callback for validating names during detector update action.

hawat.blueprints.detectors.forms.get_available_sources()[source]

Query the database for list of network record sources.