completed get api for members and created misc script for adding dummydata

This commit is contained in:
okalintu
2016-06-09 00:34:00 +03:00
parent 32905e187e
commit e8c726fb06
8 changed files with 3237 additions and 7 deletions
+18
View File
@@ -0,0 +1,18 @@
import random
import os
def generate_names(n):
'''
generates list of n random names
returns tuple(first, last)
'''
with open(os.path.join(os.path.dirname(os.path.realpath(__file__)), "firstnames.txt")) as f:
fs = f.read().split('\n')
with open(os.path.join(os.path.dirname(os.path.realpath(__file__)), "lastnames.txt")) as f:
ls = f.read().split('\n')
names = []
for i in range(n):
names.append((random.choice(fs),random.choice(ls)))
return names