utils.py
branchstable
changeset 9232 430a7dc5e2cf
parent 8941 7b26fe71404f
child 9279 0814b9dd9bf3
equal deleted inserted replaced
9231:d2edd8ac5f33 9232:430a7dc5e2cf
    47 
    47 
    48 def make_uid(key=None):
    48 def make_uid(key=None):
    49     """Return a unique identifier string.
    49     """Return a unique identifier string.
    50 
    50 
    51     if specified, `key` is used to prefix the generated uid so it can be used
    51     if specified, `key` is used to prefix the generated uid so it can be used
    52     for instance as a DOM id or as sql table names.
    52     for instance as a DOM id or as sql table name.
    53 
    53 
    54     See uuid.uuid4 documentation for the shape of the generated identifier, but
    54     See uuid.uuid4 documentation for the shape of the generated identifier, but
    55     this is basicallly a 32 bits hexadecimal string.
    55     this is basically a 32 bits hexadecimal string.
    56     """
    56     """
    57     if key is None:
    57     if key is None:
    58         return uuid4().hex
    58         return uuid4().hex
    59     return str(key) + uuid4().hex
    59     return str(key) + uuid4().hex
    60 
    60