hawat.blueprints.groups.forms module

This module contains custom group management forms for Hawat.

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

Bases: hawat.blueprints.groups.forms.BaseGroupForm

Class representing group update form for administrators.

enabled = <UnboundField(RadioField, (l'State:',), {'coerce': <function str_to_bool>, 'filters': [<function str_to_bool>], 'validators': [<wtforms.validators.InputRequired object>], 'choices': [(True, l'Enabled'), (False, l'Disabled')]})>
managers = <UnboundField(QuerySelectMultipleField, (l'Managers:',), {'query_factory': <function get_available_users>, 'allow_blank': True, 'blank_text': l'<< no selection >>', 'get_label': <function format_select_option_label_user>})>
members = <UnboundField(QuerySelectMultipleField, (l'Members:',), {'query_factory': <function get_available_users>, 'allow_blank': True, 'blank_text': l'<< no selection >>', 'get_label': <function format_select_option_label_user>})>
name = <UnboundField(StringField, (l'Name:',), {'validators': [<wtforms.validators.DataRequired object>, <wtforms.validators.Length object>, <function check_name_uniqueness>]})>
parent = <UnboundField(QuerySelectField, (l'Parent group:',), {'query_factory': <function get_available_groups>, 'allow_blank': True, 'validators': [<wtforms.validators.Optional object>, <function check_parent_not_self>], 'blank_text': l'<< no selection >>'})>
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>]})>
source = <UnboundField(HiddenField, (), {'default': 'manual', 'validators': [<wtforms.validators.DataRequired object>, <wtforms.validators.Length object>]})>
submit = <UnboundField(SubmitField, (l'Submit',), {})>
class hawat.blueprints.groups.forms.CreateGroupForm(*args, **kwargs)[source]

Bases: hawat.blueprints.groups.forms.BaseGroupForm

Class representing group create form.

enabled = <UnboundField(RadioField, (l'State:',), {'coerce': <function str_to_bool>, 'filters': [<function str_to_bool>], 'validators': [<wtforms.validators.InputRequired object>], 'choices': [(True, l'Enabled'), (False, l'Disabled')]})>
managers = <UnboundField(QuerySelectMultipleField, (l'Managers:',), {'query_factory': <function get_available_users>, 'allow_blank': True, 'blank_text': l'<< no selection >>', 'get_label': <function format_select_option_label_user>})>
members = <UnboundField(QuerySelectMultipleField, (l'Members:',), {'query_factory': <function get_available_users>, 'allow_blank': True, 'blank_text': l'<< no selection >>', 'get_label': <function format_select_option_label_user>})>
name = <UnboundField(StringField, (l'Name:',), {'validators': [<wtforms.validators.DataRequired object>, <wtforms.validators.Length object>, <function check_name_existence>]})>
parent = <UnboundField(QuerySelectField, (l'Parent group:',), {'query_factory': <function get_available_groups>, 'allow_blank': True, 'validators': [<wtforms.validators.Optional object>, <function check_parent_not_self>], 'blank_text': l'<< no selection >>'})>
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.