コード例 #1
0
ファイル: models.py プロジェクト: MorphiusInfotech/formspree
 def hashid(self):
     # A unique identifier for the form that maps to its id,
     # but doesn't seem like a sequential integer
     try:
         return self._hashid
     except AttributeError:
         if not self.id:
             raise Exception("this form doesn't have an id yet, commit it first.")
         self._hashid = HASHIDS_CODEC.encode(self.id)
     return self._hashid
コード例 #2
0
 def hashid(self):
     # A unique identifier for the form that maps to its id,
     # but doesn't seem like a sequential integer
     try:
         return self._hashid
     except AttributeError:
         if not self.id:
             raise Exception("this form doesn't have an id yet, commit it first.")
         self._hashid = HASHIDS_CODEC.encode(self.id)
     return self._hashid
コード例 #3
0
ファイル: models.py プロジェクト: myles/formspree
 def get_random_like_string(self):
     if not self.id:
         raise Exception(
             "this form doesn't have an id yet, commit it first.")
     return HASHIDS_CODEC.encode(self.id)
コード例 #4
0
ファイル: models.py プロジェクト: jean/formspree
 def get_random_like_string(self):
     if not self.id:
         raise Exception("this form doesn't have an id yet, commit it first.")
     return HASHIDS_CODEC.encode(self.id)