def genRandUsers(number): for i in range(number): first = random.choice(data["first"]) last = random.choice(data["last"]) uid = str(int(hashlib.sha224( first + str(datetime.utcnow())).hexdigest(),16))[:6] print(uid) email = first+"."+last+"@example.com" print(email) img = random.choice(IMAGES) visibility = random.choice(["PUBLIC","PRIVATE", "FOAF", "FRIENDS"]) title = random.choice([first+"'s post","NEW post", last+"'s Fave text", "Lorem Ipsum"]) description = random.choice(["Lorem Ipsum", "Sequire Non Descrir", "Latin"]) content = random.choice(lorem) # make a user u = UserModel(uid, first, last, email, "default", "abramhindle") # make a post pid = str(int(hashlib.sha224( uid + str(datetime.utcnow())).hexdigest(),16))[:6] p = PostModel(pid, uid, title, description,content, ["Lorem Ipsum", "Old Ye Engrish"], "text/plain", visibility,"") # make a comment cid = str(int(hashlib.sha224( pid + str(datetime.utcnow())).hexdigest(),16))[:6] c = CommentModel(cid, uid, pid, "hahah lol") # make a picture iid = str(int(hashlib.sha224( cid + str(datetime.utcnow())).hexdigest(),16))[:6] i = ImageModel(iid, uid, img, "user1.jpg") u.propic = i.iid db.session.add(u) db.session.add(p) db.session.add(c) db.session.commit() db.session.add(i) db.session.commit()