equal
deleted
inserted
replaced
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 |