Example #1
0
 def __init__(self, *args, **kwargs):
     """Generate uid"""
     super(Image, self).__init__(*args, **kwargs) 
     if not self.uid:
         while True:
             self.uid = utils.random_uid(length=6)
             try:
                 Image.objects.get(uid=self.uid)
             except Image.DoesNotExist:
                 break
         self.delhash = utils.generate_delhash(self.uid)
         self.save()
Example #2
0
 def __init__(self, *args, **kwargs):
     """Generate uid"""
     super(Image, self).__init__(*args, **kwargs)
     if not self.uid:
         while True:
             self.uid = utils.random_uid(length=6)
             try:
                 Image.objects.get(uid=self.uid)
             except Image.DoesNotExist:
                 break
         self.delhash = utils.generate_delhash(self.uid)
         self.save()
Example #3
0
 def __init__(self, *args, **kwargs):
     """Generate uid"""
     super(Album, self).__init__(*args, **kwargs) 
     if not self.uid:
         while True:
             self.uid = utils.random_uid(length=6,
                 codebase='beuGDya1zYohtQMU0rmgWf4nSHVcFLj8lNdv3PqiC2wIAXB5Rs9k7pOx6ZETJK')
             try:
                 Album.objects.get(uid=self.uid)
             except Album.DoesNotExist:
                 break
         self.delhash = utils.generate_delhash(self.uid)
         self.save()
Example #4
0
 def __init__(self, *args, **kwargs):
     """Generate uid"""
     super(Album, self).__init__(*args, **kwargs)
     if not self.uid:
         while True:
             self.uid = utils.random_uid(
                 length=6,
                 codebase=
                 'beuGDya1zYohtQMU0rmgWf4nSHVcFLj8lNdv3PqiC2wIAXB5Rs9k7pOx6ZETJK'
             )
             try:
                 Album.objects.get(uid=self.uid)
             except Album.DoesNotExist:
                 break
         self.delhash = utils.generate_delhash(self.uid)
         self.save()