예제 #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
파일: models.py 프로젝트: ucnedi/formspree
 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)