예제 #1
0
파일: general.py 프로젝트: missundaztood/fc
def validate_join_request():
    validators = {}
    validators['name'] = [check_required]
    validators['home'] = [check_required]
    validators['email'] = [check_required]
    validators['sex'] = [check_required, check_in(u'男性', u'女性')]
    validators['age'] = [check_required, check_in('18-20', '21-23', '24-26',
        '27-29', '30-32', '33-35', '36-38', '39-41', '42-')]
    validators['car'] = [check_required, check_in(u'あり', u'なし')]
    validators['has_racket'] = [check_required, check_in(u'あり', u'なし')]
    validators['holiday'] = [check_required, check_in(u'土日', u'日',
        u'不定期')]
    validators['experience'] = [check_required, check_in(u'初心者',
        u'初級', u'中級', u'上級', u'神、いわゆるゴッド')]
    validators['comment'] = [check_required]
    do_validate(request.form, validators)
예제 #2
0
파일: admin.py 프로젝트: missundaztood/fc
def validate_member():
    validations = OrderedDict()
    validations['name'] = [check_required]
    validations['password'] = [check_number]
    validations['sex'] = [check_in(u'男性', u'女性')]
    do_validate(request.form, validations)