hawat.blueprints.groups package

This file contains pluggable module for Hawat web interface containing features related to user group management. These features include:

  • general group listing

  • detailed group view

  • creating new groups

  • updating existing groups

  • deleting existing groups

  • enabling existing groups

  • disabling existing groups

  • adding group members

  • removing group members

  • rejecting group membership requests

class hawat.blueprints.groups.AddMemberView[source]

Bases: hawat.base.HTMLMixin, hawat.base.SQLAlchemyMixin, hawat.base.ItemObjectRelationView

View for adding group members.

authentication = True
classmethod authorize_item_action(**kwargs)[source]

Perform access authorization for current user to particular item.

classmethod change_item(**kwargs)[source]

Interface implementation of hawat.base.ItemChangeView.change_item().

dbmodel

Implementation of hawat.base.SQLAlchemyMixin.dbmodel().

dbmodel_other

Implementation of hawat.base.AddMemberView.dbmodel_other().

classmethod get_menu_legend(**kwargs)[source]

Implementation of hawat.base.BaseView.get_menu_title().

static get_message_cancel(**kwargs)[source]

Implementation of hawat.base.ItemActionView.get_message_cancel().

static get_message_failure(**kwargs)[source]

Implementation of hawat.base.ItemActionView.get_message_failure().

static get_message_success(**kwargs)[source]

Implementation of hawat.base.ItemActionView.get_message_success().

classmethod get_view_icon()[source]

Implementation of hawat.base.BaseView.get_view_icon().

classmethod get_view_name()[source]

Return unique name for the view. Name must be unique in the namespace of parent blueprint/module and should contain only characters [a-z0-9]. It will be used for generating endpoint name for the view.

This method does not have any default implementation and must be overridden by a subclass.

Returns

Name for the view.

Return type

str

classmethod get_view_title(**kwargs)[source]

Implementation of hawat.base.BaseView.get_view_title().

methods = ['GET', 'POST']
classmethod validate_item_change(**kwargs)[source]

Perform validation of particular change to given item.

hawat.blueprints.groups.BLUEPRINT_NAME = 'groups'

Name of the blueprint as module global constant.

class hawat.blueprints.groups.CreateView[source]

Bases: hawat.base.HTMLMixin, hawat.base.SQLAlchemyMixin, hawat.base.ItemCreateView

View for creating new groups.

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

Implementation of hawat.base.SQLAlchemyMixin.dbmodel().

do_before_action(item)[source]

Hook method. Will be called before successfull insertion of the item into the database.

static get_item_form()[source]

Implementation of hawat.base.ItemCreateView.get_item_form().

classmethod get_menu_title(**kwargs)[source]

Implementation of hawat.base.BaseView.get_menu_title().

static get_message_cancel(**kwargs)[source]

Implementation of hawat.base.ItemActionView.get_message_cancel().

static get_message_failure(**kwargs)[source]

Implementation of hawat.base.ItemActionView.get_message_failure().

static get_message_success(**kwargs)[source]

Implementation of hawat.base.ItemActionView.get_message_success().

classmethod get_view_title(**kwargs)[source]

Implementation of hawat.base.BaseView.get_view_title().

methods = ['GET', 'POST']
class hawat.blueprints.groups.DeleteView[source]

Bases: hawat.base.HTMLMixin, hawat.base.SQLAlchemyMixin, hawat.base.ItemDeleteView

View for deleting existing groups.

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

Implementation of hawat.base.SQLAlchemyMixin.dbmodel().

classmethod get_menu_legend(**kwargs)[source]

Interface implementation of hawat.base.BaseView.get_menu_legend().

static get_message_cancel(**kwargs)[source]

Implementation of hawat.base.ItemActionView.get_message_cancel().

static get_message_failure(**kwargs)[source]

Implementation of hawat.base.ItemActionView.get_message_failure().

static get_message_success(**kwargs)[source]

Implementation of hawat.base.ItemActionView.get_message_success().

methods = ['GET', 'POST']
class hawat.blueprints.groups.DisableView[source]

Bases: hawat.base.HTMLMixin, hawat.base.SQLAlchemyMixin, hawat.base.ItemDisableView

View for disabling groups.

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

Implementation of hawat.base.SQLAlchemyMixin.dbmodel().

classmethod get_menu_legend(**kwargs)[source]

Implementation of hawat.base.BaseView.get_menu_title().

static get_message_cancel(**kwargs)[source]

Implementation of hawat.base.ItemActionView.get_message_cancel().

static get_message_failure(**kwargs)[source]

Implementation of hawat.base.ItemActionView.get_message_failure().

static get_message_success(**kwargs)[source]

Implementation of hawat.base.ItemActionView.get_message_success().

methods = ['GET', 'POST']
class hawat.blueprints.groups.EnableView[source]

Bases: hawat.base.HTMLMixin, hawat.base.SQLAlchemyMixin, hawat.base.ItemEnableView

View for enabling existing groups.

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

Implementation of hawat.base.SQLAlchemyMixin.dbmodel().

classmethod get_menu_legend(**kwargs)[source]

Implementation of hawat.base.BaseView.get_menu_title().

static get_message_cancel(**kwargs)[source]

Implementation of hawat.base.ItemActionView.get_message_cancel().

static get_message_failure(**kwargs)[source]

Implementation of hawat.base.ItemActionView.get_message_failure().

static get_message_success(**kwargs)[source]

Implementation of hawat.base.ItemActionView.get_message_success().

methods = ['GET', 'POST']
class hawat.blueprints.groups.GroupsBlueprint(name, import_name, **kwargs)[source]

Bases: hawat.base.HawatBlueprint

Hawat pluggable module - abuse groups.

classmethod get_module_title()[source]

Implementation of hawat.base.HawatBlueprint.get_module_title().

register_app(app)[source]

Callback method. Will be called from hawat.base.HawatApp.register_blueprint() method and can be used to customize the Flask application object. Possible use cases:

  • application menu customization

Parameters

app (hawat.base.HawatApp) – Flask application to be customize.

class hawat.blueprints.groups.ListView[source]

Bases: hawat.base.HTMLMixin, hawat.base.SQLAlchemyMixin, hawat.base.ItemListView

General group listing.

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

Implementation of hawat.base.SQLAlchemyMixin.dbmodel().

classmethod get_action_menu()[source]

Implementation of hawat.base.ItemListView.get_action_menu().

classmethod get_context_action_menu()[source]

Implementation of hawat.base.ItemListView.get_context_action_menu().

classmethod get_view_title(**kwargs)[source]

Implementation of hawat.base.BaseView.get_menu_title().

methods = ['GET']
class hawat.blueprints.groups.RejectMemberView[source]

Bases: hawat.base.HTMLMixin, hawat.base.SQLAlchemyMixin, hawat.base.ItemObjectRelationView

View for rejecting group membership reuests.

authentication = True
classmethod authorize_item_action(**kwargs)[source]

Perform access authorization for current user to particular item.

classmethod change_item(**kwargs)[source]

Interface implementation of hawat.base.ItemChangeView.change_item().

dbmodel

Implementation of hawat.base.SQLAlchemyMixin.dbmodel().

dbmodel_other

Implementation of hawat.base.AddMemberView.dbmodel_other().

classmethod get_menu_legend(**kwargs)[source]

Implementation of hawat.base.BaseView.get_menu_title().

static get_message_cancel(**kwargs)[source]

Implementation of hawat.base.ItemActionView.get_message_cancel().

static get_message_failure(**kwargs)[source]

Implementation of hawat.base.ItemActionView.get_message_failure().

static get_message_success(**kwargs)[source]

Implementation of hawat.base.ItemActionView.get_message_success().

classmethod get_view_icon()[source]

Implementation of hawat.base.BaseView.get_view_icon().

classmethod get_view_name()[source]

Return unique name for the view. Name must be unique in the namespace of parent blueprint/module and should contain only characters [a-z0-9]. It will be used for generating endpoint name for the view.

This method does not have any default implementation and must be overridden by a subclass.

Returns

Name for the view.

Return type

str

classmethod get_view_title(**kwargs)[source]

Implementation of hawat.base.BaseView.get_view_title().

methods = ['GET', 'POST']
classmethod validate_item_change(**kwargs)[source]

Perform validation of particular change to given item.

class hawat.blueprints.groups.RemoveMemberView[source]

Bases: hawat.base.HTMLMixin, hawat.base.SQLAlchemyMixin, hawat.base.ItemObjectRelationView

View for removing group members.

authentication = True
classmethod authorize_item_action(**kwargs)[source]

Perform access authorization for current user to particular item.

classmethod change_item(**kwargs)[source]

Interface implementation of hawat.base.ItemChangeView.change_item().

dbmodel

Implementation of hawat.base.SQLAlchemyMixin.dbmodel().

dbmodel_other

Implementation of hawat.base.AddMemberView.dbmodel_other().

classmethod get_menu_legend(**kwargs)[source]

Implementation of hawat.base.BaseView.get_menu_title().

static get_message_cancel(**kwargs)[source]

Implementation of hawat.base.ItemActionView.get_message_cancel().

static get_message_failure(**kwargs)[source]

Implementation of hawat.base.ItemActionView.get_message_failure().

static get_message_success(**kwargs)[source]

Implementation of hawat.base.ItemActionView.get_message_success().

classmethod get_view_icon()[source]

Implementation of hawat.base.BaseView.get_view_icon().

classmethod get_view_name()[source]

Return unique name for the view. Name must be unique in the namespace of parent blueprint/module and should contain only characters [a-z0-9]. It will be used for generating endpoint name for the view.

This method does not have any default implementation and must be overridden by a subclass.

Returns

Name for the view.

Return type

str

classmethod get_view_title(**kwargs)[source]

Implementation of hawat.base.BaseView.get_view_title().

methods = ['GET', 'POST']
classmethod validate_item_change(**kwargs)[source]

Perform validation of particular change to given item.

class hawat.blueprints.groups.ShowByNameView[source]

Bases: hawat.blueprints.groups.ShowView

Detailed group view by group name.

classmethod get_view_name()[source]

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

classmethod get_view_template()[source]

Implementation of hawat.base.RenderableView.get_view_template().

search_by

Interface implementation of hawat.base.ItemShowView.search_by().

class hawat.blueprints.groups.ShowView[source]

Bases: hawat.base.HTMLMixin, hawat.base.SQLAlchemyMixin, hawat.base.ItemShowView

Detailed group view.

authentication = True
classmethod authorize_item_action(**kwargs)[source]

Perform access authorization for current user to particular item.

dbmodel

Implementation of hawat.base.SQLAlchemyMixin.dbmodel().

do_before_response(**kwargs)[source]

Implementation of hawat.base.RenderableView.do_before_response().

classmethod get_action_menu()[source]

Get action menu for particular item.

classmethod get_menu_legend(**kwargs)[source]

Implementation of hawat.base.BaseView.get_menu_title().

classmethod get_view_title(**kwargs)[source]

Implementation of hawat.base.BaseView.get_view_title().

classmethod get_view_url(**kwargs)[source]

Implementation of hawat.base.BaseView.get_view_url().

methods = ['GET']
class hawat.blueprints.groups.UpdateView[source]

Bases: hawat.base.HTMLMixin, hawat.base.SQLAlchemyMixin, hawat.base.ItemUpdateView

View for updating existing groups.

authentication = True
classmethod authorize_item_action(**kwargs)[source]

Perform access authorization for current user to particular item.

dbmodel

Implementation of hawat.base.SQLAlchemyMixin.dbmodel().

static get_item_form(item)[source]

Implementation of hawat.base.ItemUpdateView.get_item_form().

classmethod get_menu_legend(**kwargs)[source]

Implementation of hawat.base.BaseView.get_menu_title().

classmethod get_menu_title(**kwargs)[source]

Implementation of hawat.base.BaseView.get_menu_title().

static get_message_cancel(**kwargs)[source]

Implementation of hawat.base.ItemActionView.get_message_cancel().

static get_message_failure(**kwargs)[source]

Implementation of hawat.base.ItemActionView.get_message_failure().

static get_message_success(**kwargs)[source]

Implementation of hawat.base.ItemActionView.get_message_success().

classmethod get_view_title(**kwargs)[source]

Implementation of hawat.base.BaseView.get_view_title().

methods = ['GET', 'POST']
hawat.blueprints.groups.get_blueprint()[source]

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