utils.py
branchstable
changeset 3364 039d1694f36d
parent 3316 c4c07aab1c39
child 3369 7b88d12b4ee2
child 3371 762a7bc3b73d
equal deleted inserted replaced
3363:d3736311d0c4 3364:039d1694f36d
   116         msg = str(key) + "%.10f" % time() + str(randint(0, 1000000))
   116         msg = str(key) + "%.10f" % time() + str(randint(0, 1000000))
   117         return md5(msg).hexdigest()
   117         return md5(msg).hexdigest()
   118 else:
   118 else:
   119     from uuid import uuid4
   119     from uuid import uuid4
   120     def make_uid(key):
   120     def make_uid(key):
   121         return str(key) + str(uuid4())
   121         # remove dash, generated uid are used as identifier sometimes (sql table
       
   122         # names at least)
       
   123         return str(key) + str(uuid4()).replace('-', '')
       
   124 
   122 
   125 
   123 def dump_class(cls, clsname):
   126 def dump_class(cls, clsname):
   124     """create copy of a class by creating an empty class inheriting
   127     """create copy of a class by creating an empty class inheriting
   125     from the given cls.
   128     from the given cls.
   126 
   129