コード例 #1
0
ファイル: forms.py プロジェクト: echevemaster/elections
 def validate_alias(form, field):
     if form.alias.data == 'new':
         raise wtforms.ValidationError(flask.Markup(
             'The alias cannot be <code>new</code>.'))
     check = Election.search(SESSION, alias=form.alias.data)
     if check:
         if not (form._election_id and form._election_id == check[0].id):
             raise wtforms.ValidationError(
                 'There is already another election with this alias.')
コード例 #2
0
ファイル: forms.py プロジェクト: Tubbz-alt/elections
 def validate_alias(form, field):
     if form.alias.data == 'new':
         raise wtforms.ValidationError(flask.Markup(
             'The alias cannot be <code>new</code>.'))
     check = Election.search(SESSION, alias=form.alias.data)
     if check:
         if not (form._election_id and form._election_id == check[0].id):
             raise wtforms.ValidationError(
                 'There is already another election with this alias.')
コード例 #3
0
ファイル: forms.py プロジェクト: echevemaster/elections
 def validate_shortdesc(form, field):
     check = Election.search(SESSION, shortdesc=form.shortdesc.data)
     if check:
         if not (form._election_id and form._election_id == check[0].id):
             raise wtforms.ValidationError(
                 'There is already another election with this summary.')
コード例 #4
0
ファイル: forms.py プロジェクト: Tubbz-alt/elections
 def validate_shortdesc(form, field):
     check = Election.search(SESSION, shortdesc=form.shortdesc.data)
     if check:
         if not (form._election_id and form._election_id == check[0].id):
             raise wtforms.ValidationError(
                 'There is already another election with this summary.')