Esempio n. 1
0
 def get_or_create_short(self, url):
     short_url = cache.get(url)
     if not short_url:
         short, created = self.get_or_create(url=url)
         short_url = hexahexacontadecimal_encode_int(short.id)
         cache.set(url, short_url, None)
     return short_url
Esempio n. 2
0
 def short(self):
     return hexahexacontadecimal_encode_int(self.id)