Ejemplo n.º 1
0
def CategoryRolesACLFormFactory(role, category_roles, selected_role):
    attrs = {
        'role':
        role,
        'category_role':
        forms.ModelChoiceField(label=_("Role"),
                               required=False,
                               queryset=category_roles,
                               initial=selected_role,
                               empty_label=_("No access"))
    }

    return type('CategoryRolesACLForm', (forms.Form, ), attrs)
Ejemplo n.º 2
0
def RoleForumACLFormFactory(forum, forum_roles, selected_role):
    attrs = {
        'forum':
        forum,
        'role':
        forms.ModelChoiceField(label=_("Role"),
                               required=False,
                               queryset=forum_roles,
                               initial=selected_role,
                               empty_label=_("No access"))
    }

    return type('RoleForumACLForm', (forms.Form, ), attrs)