示例#1
0
 def get_with_hashid(cls, hashid):
     id = HASHIDS_CODEC.decode(hashid)[0]
     return cls.query.get(id)
示例#2
0
 def get_with_hashid(cls, hashid):
     try:
         id = HASHIDS_CODEC.decode(hashid)[0]
         return cls.query.get(id)
     except IndexError:
         return None
示例#3
0
文件: models.py 项目: myles/formspree
 def get_form_by_random_like_string(cls, random_like_string):
     id = HASHIDS_CODEC.decode(random_like_string)[0]
     return cls.query.get(id)
示例#4
0
 def get_with_hashid(cls, hashid):
     try:
         id = HASHIDS_CODEC.decode(hashid)[0]
         return cls.query.get(id)
     except IndexError:
         return None
示例#5
0
 def get_with_hashid(cls, hashid):
     id = HASHIDS_CODEC.decode(hashid)[0]
     return cls.query.get(id)