author | Madhusudan.C.S <madhusudancs@gmail.com> |
Sat, 15 Jan 2011 03:57:25 +0530 | |
changeset 406 | 6cd8eda4d8df |
parent 405 | 76d13cdeefc7 |
child 407 | fe51e9080a17 |
pytask/utils.py | file | annotate | diff | comparison | revisions |
--- a/pytask/utils.py Sat Jan 15 01:19:48 2011 +0530 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ -import string,random - -def make_key(model_name): - """ return a 10 character random key. - """ - - while True: - key = ''.join([ random.choice(string.uppercase+string.digits) for i in range(10)]) - try: - model_name.objects.get(uniq_key=key) - except model_name.DoesNotExist: - return key -