comparison rhodecode/model/forms.py @ 1112:6d0a7284949d beta

#109, added optional clone uri when creating repo. Cleaned up repos controller moved common code into __load_data
author Marcin Kuzminski <marcin@python-works.com>
date Sat, 05 Mar 2011 21:59:47 +0100
parents 4f834b0abcd3
children 187a924ed653
comparison
equal deleted inserted replaced
1111:4b62d2fea08a 1112:6d0a7284949d
448 allow_extra_fields = True 448 allow_extra_fields = True
449 filter_extra_fields = True 449 filter_extra_fields = True
450 email = All(ValidSystemEmail(), Email(not_empty=True)) 450 email = All(ValidSystemEmail(), Email(not_empty=True))
451 return _PasswordResetForm 451 return _PasswordResetForm
452 452
453 def RepoForm(edit=False, old_data={}, supported_backends=BACKENDS.keys()): 453 def RepoForm(edit=False, old_data={}, supported_backends=BACKENDS.keys(),
454 repo_groups=[]):
454 class _RepoForm(formencode.Schema): 455 class _RepoForm(formencode.Schema):
455 allow_extra_fields = True 456 allow_extra_fields = True
456 filter_extra_fields = False 457 filter_extra_fields = False
457 repo_name = All(UnicodeString(strip=True, min=1, not_empty=True), 458 repo_name = All(UnicodeString(strip=True, min=1, not_empty=True),
458 ValidRepoName(edit, old_data)) 459 ValidRepoName(edit, old_data))
460 clone_uri = UnicodeString(strip=True, min=1, not_empty=False)
461 repo_group = OneOf(repo_groups)
462 repo_type = OneOf(supported_backends)
459 description = UnicodeString(strip=True, min=1, not_empty=True) 463 description = UnicodeString(strip=True, min=1, not_empty=True)
460 private = StringBoolean(if_missing=False) 464 private = StringBoolean(if_missing=False)
461 enable_statistics = StringBoolean(if_missing=False) 465 enable_statistics = StringBoolean(if_missing=False)
462 enable_downloads = StringBoolean(if_missing=False) 466 enable_downloads = StringBoolean(if_missing=False)
463 repo_type = OneOf(supported_backends) 467
464 if edit: 468 if edit:
465 #this is repo owner 469 #this is repo owner
466 user = All(Int(not_empty=True), ValidRepoUser) 470 user = All(Int(not_empty=True), ValidRepoUser)
467 471
468 chained_validators = [ValidPerms] 472 chained_validators = [ValidPerms]