Geoffrey-Django/GeoffreyApp/util.py

15 lines
265 B
Python
Raw Normal View History

2019-07-21 14:58:38 +00:00
from django.utils.crypto import get_random_string
def create_token(length=25):
2019-07-21 14:58:38 +00:00
return get_random_string(length=length)
def objects_list_to_json(obj_list):
json_list = []
for obj in obj_list:
json_list.append(obj.json)
return json_list