hawat.blueprints.hosts package

This file contains pluggable module for Hawat web interface containing features related to real time dashboard calculations for IDEA events. This module is currently experimental, because the searching and statistical calculations can be very performance demanding.

class hawat.blueprints.hosts.APISearchView[source]

Bases: AJAXMixin, AbstractSearchView

View responsible for querying IDEA event database and presenting the results in the form of JSON document.

classmethod get_view_name()[source]

Implementation of hawat.view.BaseView.get_view_name().

methods: t.ClassVar[t.Optional[t.Collection[str]]] = ['GET', 'POST']

The methods this view is registered for. Uses the same default (["GET", "HEAD", "OPTIONS"]) as route and add_url_rule by default.

class hawat.blueprints.hosts.AbstractSearchView[source]

Bases: PsycopgMixin, BaseSearchView

Base class for view responsible for searching…

authentication = True

Similar to the decorators mechanism in Flask pluggable views, you may use this class variable to specify, that the view is protected by authentication. During the process of registering the view into the blueprint in hawat.app.hawatBlueprint.register_view_class() the view will be automatically decorated with flask_login.login_required() decorator.

The advantage of using this in favor of decorators is that the application menu can automatically hide/show items inaccessible to current user.

This is a scalar variable that must contain boolean True or False.

authorization = [<Permission needs={Need(method='role', value='admin'), Need(method='role', value='maintainer')} excludes=set()>]

Similar to the decorators mechanism in Flask pluggable views, you may use this class variable to specify, that the view is protected by authorization. During the process of registering the view into the blueprint in hawat.app.hawatBlueprint.register_view_class() the view will be automatically decorated with given authorization decorators.

The advantage of using this in favor of decorators is that the application menu can automatically hide/show items inaccessible to current user.

This is a list variable that must contain list of desired decorators.

This hook method will be called after successfull search.

do_before_response(**kwargs)[source]

This method will be called just before generating the response. By providing some meaningfull implementation you can use it for some simple item and response context mangling tasks.

Parameters

kwargs – Custom additional arguments.

static get_event_columns()[source]
static get_event_factory()[source]
classmethod get_menu_title(**kwargs)[source]

Return menu entry title for the view.

Default implementation returns the return value of hawat.view.BaseView.get_view_title() method by default.

Parameters

kwargs (dict) – Optional parameters.

Returns

Menu entry title for the view.

Return type

str

static get_search_form(request_args)[source]

Must return instance of flask_wtf.FlaskForm appropriate for searching given type of items.

classmethod get_view_icon()[source]

Implementation of mydojo.base.BaseView.get_view_name().

classmethod get_view_title(**kwargs)[source]

Return title for the view, that will be displayed in the title tag of HTML head element and also as the content of page header in h2 tag.

Default implementation returns the return value of hawat.view.BaseView.get_menu_title() method by default.

Parameters

kwargs (dict) – Optional parameters.

Returns

Title for the view.

Return type

str

hawat.blueprints.hosts.BLUEPRINT_NAME = 'hosts'

Name of the blueprint as module global constant.

class hawat.blueprints.hosts.HostsBlueprint(name, import_name, **kwargs)[source]

Bases: HawatBlueprint

Pluggable module - Host overview (hosts).

classmethod get_module_title()[source]

Get human readable name for this blueprint/module.

Returns

Name (short summary) of the blueprint/module.

Return type

str

register_app(app)[source]

Hook method: Custom callback, which will be called from hawat.app.Hawat.register_blueprint() method and which can perform additional tweaking of Hawat application object.

Parameters

app (hawat.app.Hawat) – Application object.

class hawat.blueprints.hosts.SearchView[source]

Bases: HTMLMixin, AbstractSearchView

View responsible for querying IDEA event database and presenting the results in the form of HTML page.

classmethod get_breadcrumbs_menu()[source]

Get breadcrumbs menu.

methods: t.ClassVar[t.Optional[t.Collection[str]]] = ['GET']

The methods this view is registered for. Uses the same default (["GET", "HEAD", "OPTIONS"]) as route and add_url_rule by default.

hawat.blueprints.hosts.get_blueprint()[source]

Mandatory interface for hawat.Hawat and factory function. This function must return a valid instance of hawat.app.HawatBlueprint or flask.Blueprint.