2018-12-30 01:41:18 +00:00
|
|
|
import string
|
|
|
|
import random
|
|
|
|
|
|
|
|
|
|
|
|
def create_token(length=25):
|
|
|
|
token = ''
|
|
|
|
|
|
|
|
for i in range(0, length):
|
|
|
|
d = random.choice(string.digits + string.ascii_lowercase)
|
|
|
|
token += d
|
|
|
|
|
|
|
|
return token
|
2019-02-02 22:31:02 +00:00
|
|
|
|
|
|
|
|
|
|
|
def objects_list_to_json(obj_list):
|
|
|
|
json_list = []
|
|
|
|
|
|
|
|
for obj in obj_list:
|
|
|
|
json_list.append(obj.json)
|
|
|
|
|
|
|
|
return json_list
|