hawat.blueprints.changelogs package
This pluggable module provides access to item changelogs.
- hawat.blueprints.changelogs.BLUEPRINT_NAME = 'changelogs'
Name of the blueprint as module global constant.
- class hawat.blueprints.changelogs.ItemChangeLogsBlueprint(name, import_name, **kwargs)[source]
Bases:
HawatBlueprint
Pluggable module - item changelog record management (changelogs).
- class hawat.blueprints.changelogs.SearchView[source]
Bases:
HTMLMixin
,SQLAlchemyMixin
,BaseSearchView
General item changelog record listing.
- 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 inhawat.app.hawatBlueprint.register_view_class()
the view will be automatically decorated withflask_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
orFalse
.
- 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 inhawat.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.
- static build_query(query, model, form_args)[source]
Hook method. Modify given query according to the given arguments.
- property dbmodel
This property must be implemented in each subclass to return reference to appropriate model class based on SQLAlchemy declarative base.
Implementation of
hawat.view.ItemListView.get_context_action_menu()
.
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_title(**kwargs)[source]
Return title for the view, that will be displayed in the
title
tag of HTMLhead
element and also as the content of page header inh2
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
- methods: ClassVar[Optional[Collection[str]]] = ['GET']
The methods this view is registered for. Uses the same default (
["GET", "HEAD", "OPTIONS"]
) asroute
andadd_url_rule
by default.
- class hawat.blueprints.changelogs.ShowView[source]
Bases:
HTMLMixin
,SQLAlchemyMixin
,ItemShowView
Detailed network record view.
- 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 inhawat.app.hawatBlueprint.register_view_class()
the view will be automatically decorated withflask_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
orFalse
.
- 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 inhawat.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.
- property dbmodel
This property must be implemented in each subclass to return reference to appropriate model class based on SQLAlchemy declarative base.
Get breadcrumbs menu.
Return menu entry legend for the view (menu entry hover tooltip).
Default implementation returns the return value of
hawat.view.BaseView.get_menu_title()
method by default.- Parameters
kwargs (dict) – Optional parameters.
- Returns
Menu entry legend for the view.
- Return type
str
Implementation of
hawat.view.BaseView.get_menu_title()
.
- classmethod get_view_title(**kwargs)[source]
Implementation of
hawat.view.BaseView.get_view_title()
.
- methods: ClassVar[Optional[Collection[str]]] = ['GET']
The methods this view is registered for. Uses the same default (
["GET", "HEAD", "OPTIONS"]
) asroute
andadd_url_rule
by default.
- hawat.blueprints.changelogs.get_blueprint()[source]
Mandatory interface for
hawat.Hawat
and factory function. This function must return a valid instance ofhawat.app.HawatBlueprint
orflask.Blueprint
.