hawat.blueprints.groups.forms module

This module contains custom group management forms for Hawat.

class hawat.blueprints.groups.forms.AdminBaseGroupForm(*args, **kwargs)[source]

Bases: hawat.blueprints.groups.forms.BaseGroupForm

Class representing group create form.

enabled = <UnboundField(RadioField, (l'State:',), {'description': l'Boolean flag whether the group is enabled or disabled. Disabled groups are hidden to the most of the system features.', 'choices': [(True, l'Enabled'), (False, l'Disabled')], 'validators': [<wtforms.validators.InputRequired object>], 'coerce': <function str_to_bool>, 'filters': [<function str_to_bool>]})>
managers = <UnboundField(QuerySelectMultipleField, (l'Managers:',), {'query_factory': <function get_available_users>, 'description': l'List of users acting as group managers. These users may change various group settings.', 'blank_text': l'<< no selection >>', 'allow_blank': True, 'get_label': <function format_select_option_label_user>})>
parent = <UnboundField(QuerySelectField, (l'Parent group:',), {'query_factory': <function get_available_groups>, 'description': l'Parent group for this group. This feature enables the posibility to create structured group hierarchy.', 'allow_blank': True, 'validators': [<wtforms.validators.Optional object>, <function check_parent_not_self>], 'blank_text': l'<< no selection >>'})>
class hawat.blueprints.groups.forms.AdminCreateGroupForm(*args, **kwargs)[source]

Bases: hawat.blueprints.groups.forms.AdminBaseGroupForm

Class representing group create form for administrators.

name = <UnboundField(StringField, (l'Name:',), {'description': l'System-wide unique name for the group.', 'validators': [<wtforms.validators.DataRequired object>, <wtforms.validators.Length object>, <function check_name_existence>]})>
class hawat.blueprints.groups.forms.AdminUpdateGroupForm(*args, **kwargs)[source]

Bases: hawat.blueprints.groups.forms.AdminBaseGroupForm

Class representing group update form for administrators.

name = <UnboundField(StringField, (l'Name:',), {'description': l'System-wide unique name for the group.', 'validators': [<wtforms.validators.DataRequired object>, <wtforms.validators.Length object>, <function check_name_uniqueness>]})>
class hawat.blueprints.groups.forms.BaseGroupForm(*args, **kwargs)[source]

Bases: hawat.forms.BaseItemForm

Class representing base group form.

cancel = <UnboundField(SubmitField, (l'Cancel',), {})>
description = <UnboundField(StringField, (l'Description:',), {'description': l'Additional and more extensive group description.', 'validators': [<wtforms.validators.DataRequired object>]})>
managed = <UnboundField(RadioField, (l'Self management:',), {'description': l'Boolean flag whether the group is self managed by group managers. When enabled group managers are expected to take care of the group management tasks and they get notifications about important events like group membership requests, etc.', 'choices': [(True, l'Enabled'), (False, l'Disabled')], 'validators': [<wtforms.validators.InputRequired object>], 'coerce': <function str_to_bool>, 'filters': [<function str_to_bool>]})>
members = <UnboundField(QuerySelectMultipleField, (l'Members:',), {'query_factory': <function get_available_users>, 'description': l'List of group members.', 'blank_text': l'<< no selection >>', 'allow_blank': True, 'get_label': <function format_select_option_label_user>})>
source = <UnboundField(HiddenField, (), {'default': 'manual', 'description': l'Origin of the group record, whether it was added manually, or via some automated mechanism from data from some third party system.', 'validators': [<wtforms.validators.DataRequired object>, <wtforms.validators.Length object>]})>
submit = <UnboundField(SubmitField, (l'Submit',), {})>
class hawat.blueprints.groups.forms.UpdateGroupForm(*args, **kwargs)[source]

Bases: hawat.blueprints.groups.forms.BaseGroupForm

Class representing group update form for regular users.

hawat.blueprints.groups.forms.check_name_existence(form, field)[source]

Callback for validating user logins during account create action.

hawat.blueprints.groups.forms.check_name_uniqueness(form, field)[source]

Callback for validating user logins during account update action.

hawat.blueprints.groups.forms.check_parent_not_self(form, field)[source]

Callback for validating that parent group is not self.

hawat.blueprints.groups.forms.format_select_option_label_user(item)[source]

Format option for selection of user accounts.

hawat.blueprints.groups.forms.get_available_groups()[source]

Query the database for list of all available groups.

hawat.blueprints.groups.forms.get_available_users()[source]

Query the database for list of all available user accounts.