Пример #1
0
    class _ReposGroupForm(formencode.Schema):
        allow_extra_fields = True
        filter_extra_fields = False

        group_name = All(v.UnicodeString(strip=True, min=1, not_empty=True),
                               v.SlugifyName())
        group_description = v.UnicodeString(strip=True, min=1,
                                                not_empty=False)
        if edit:
            #FIXME: do a special check that we cannot move a group to one of
            #it's children
            pass
        group_parent_id = All(v.CanCreateGroup(can_create_in_root),
                              v.OneOf(available_groups, hideList=False,
                                      testValueList=True,
                                      if_missing=None, not_empty=True))
        enable_locking = v.StringBoolean(if_missing=False)
        recursive = v.StringBoolean(if_missing=False)
        chained_validators = [v.ValidReposGroup(edit, old_data),
                              v.ValidPerms('group')]
Пример #2
0
 class _UserPermsForm(formencode.Schema):
     allow_extra_fields = True
     filter_extra_fields = False
     chained_validators = [v.ValidPerms(type_='user_group')]
Пример #3
0
 class _RepoGroupPermsForm(formencode.Schema):
     allow_extra_fields = True
     filter_extra_fields = False
     recursive = v.StringBoolean(if_missing=False)
     chained_validators = [v.ValidPerms(type_='repo_group')]
Пример #4
0
 class _RepoPermsForm(formencode.Schema):
     allow_extra_fields = True
     filter_extra_fields = False
     chained_validators = [v.ValidPerms(type_='repo')]
Пример #5
0
 class _RepoGroupPermsForm(formencode.Schema):
     allow_extra_fields = True
     filter_extra_fields = False
     recursive = v.OneOf(valid_recursive_choices)
     chained_validators = [v.ValidPerms(type_='repo_group')]