コード例 #1
0
 def validate_bname(self, bname):
     brand = find_first_query(engine, bname.data, "bname", "brands")
     if brand is not None:
         raise ValidationError('Please use a different name.')
コード例 #2
0
 def validate_comment(self, comment):
     user = find_first_query(engine, comment.data, "content", "communities")
     if user is not None:
         raise ValidationError('Please say something different.')
コード例 #3
0
 def validate_bid(self, bid):
     brand = find_first_query(engine, bid.data, "bid", "brands")
     if brand is not None:
         raise ValidationError('Please use a different ID.')
コード例 #4
0
 def validate_cname(self, cname):
     user = find_first_query(engine, cname.data, "cname", "customers")
     if user is not None:
         raise ValidationError('Please use a different username.')
コード例 #5
0
 def validate_cateid(self, cateid):
     cate = find_first_query(engine, cateid.data, "cateid", "categories")
     if cate is not None:
         raise ValidationError('No such category found!')
コード例 #6
0
 def validate_bid(self, bid):
     brand = find_first_query(engine, bid.data, "bid", "brands")
     if brand is None:
         raise ValidationError('No such company found!')
コード例 #7
0
 def validate_pname(self, pname):
     product = find_first_query(engine, pname.data, "pname", "products")
     if product is not None:
         raise ValidationError('Please use a different name.')
コード例 #8
0
 def validate_pid(self, pid):
     product = find_first_query(engine, pid.data, "pid", "products")
     if product is not None:
         raise ValidationError('Please use a different ID.')