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:',), {'validators': [<wtforms.validators.InputRequired object>], 'choices': [(True, l'Enabled'), (False, l'Disabled')], 'filters': [<function str_to_bool>], 'coerce': <function str_to_bool>, 'description': l'Boolean flag whether the group is enabled or disabled. Disabled groups are hidden to the most of the system features.'})>
managers = <UnboundField(QuerySelectMultipleField, (l'Managers:',), {'query_factory': <function get_available_users>, 'get_label': <function format_select_option_label_user>, 'allow_blank': True, 'blank_text': l'<< no selection >>', 'description': l'List of users acting as group managers. These users may change various group settings.'})>
parent = <UnboundField(QuerySelectField, (l'Parent group:',), {'validators': [<wtforms.validators.Optional object>, <function check_parent_not_self>], 'query_factory': <function get_available_groups>, 'allow_blank': True, 'blank_text': l'<< no selection >>', 'description': l'Parent group for this group. This feature enables the posibility to create structured group hierarchy.'})>
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:',), {'validators': [<wtforms.validators.DataRequired object>, <wtforms.validators.Length object>, <function check_name_existence>], 'description': l'System-wide unique name for the group.'})>
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:',), {'validators': [<wtforms.validators.DataRequired object>, <wtforms.validators.Length object>, <function check_name_uniqueness>], 'description': l'System-wide unique name for the group.'})>
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:',), {'validators': [<wtforms.validators.DataRequired object>], 'description': l'Additional and more extensive group description.'})>
managed = <UnboundField(RadioField, (l'Self management:',), {'validators': [<wtforms.validators.InputRequired object>], 'choices': [(True, l'Enabled'), (False, l'Disabled')], 'filters': [<function str_to_bool>], 'coerce': <function str_to_bool>, '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.'})>
members = <UnboundField(QuerySelectMultipleField, (l'Members:',), {'query_factory': <function get_available_users>, 'get_label': <function format_select_option_label_user>, 'allow_blank': True, 'blank_text': l'<< no selection >>', 'description': l'List of group members.'})>
source = <UnboundField(HiddenField, (), {'default': 'manual', 'validators': [<wtforms.validators.DataRequired object>, <wtforms.validators.Length object>], 'description': l'Origin of the group record, whether it was added manually, or via some automated mechanism from data from some third party system.'})>
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.