taskapp/utilities/helper.py
author anoop
Tue, 09 Mar 2010 11:39:34 +0530
changeset 214 679c7e237052
parent 119 39ab7c460143
permissions -rw-r--r--
added two more templates for displaying admin login form and admin logout message.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
119
39ab7c460143 did lots and now id field in task is a random key
nishanth
parents:
diff changeset
     1
import string,random
39ab7c460143 did lots and now id field in task is a random key
nishanth
parents:
diff changeset
     2
39ab7c460143 did lots and now id field in task is a random key
nishanth
parents:
diff changeset
     3
def get_key():
39ab7c460143 did lots and now id field in task is a random key
nishanth
parents:
diff changeset
     4
    """ return a 10 character random key.
39ab7c460143 did lots and now id field in task is a random key
nishanth
parents:
diff changeset
     5
    """
39ab7c460143 did lots and now id field in task is a random key
nishanth
parents:
diff changeset
     6
    
39ab7c460143 did lots and now id field in task is a random key
nishanth
parents:
diff changeset
     7
    return ''.join([ random.choice(string.uppercase+string.digits) for i in range(10)])
39ab7c460143 did lots and now id field in task is a random key
nishanth
parents:
diff changeset
     8