mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
add aurweb.models.session.Session ORM database object
+ Added aurweb.util module. - Added make_random_string function. + Added aurweb.db.make_random_value function. - Takes a model and a column and introspects them to figure out the proper column length to create a random string for; then creates a unique string for that column. Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
adc9fccb7d
commit
1922e5380d
4 changed files with 129 additions and 1 deletions
7
aurweb/util.py
Normal file
7
aurweb/util.py
Normal file
|
@ -0,0 +1,7 @@
|
|||
import random
|
||||
import string
|
||||
|
||||
|
||||
def make_random_string(length):
|
||||
return ''.join(random.choices(string.ascii_lowercase +
|
||||
string.digits, k=length))
|
Loading…
Add table
Add a link
Reference in a new issue