Source code for user.forms.group

from onegov.form import Form
from onegov.user import _
from wtforms.fields import StringField
from wtforms.validators import InputRequired


from typing import TYPE_CHECKING
if TYPE_CHECKING:
    from onegov.user import UserGroup


[docs] class UserGroupForm(Form): """ A generic user group form for onegov.user """
[docs] name = StringField( label=_('Name'), validators=[ InputRequired() ] )
[docs] def update_model(self, model: 'UserGroup') -> None: model.name = self.name.data
[docs] def apply_model(self, model: 'UserGroup') -> None: self.name.data = model.name