def _user_generator(count): ''' Generate a collection of users given a count :input count: The number of users to create :returns: A user generator ''' for id in xrange(2, count): yield return { # 'id':id, 'username':'******' % id, 'password':'******' % id, 'email':'*****@*****.**' % id, 'first_name':lorem.words(1, common=False), 'last_name':lorem.words(1, common=False), }
def _user_profile_generator(count): ''' Generate a collection of users given a count :input count: The number of users to create :returns: A user generator ''' gender = ['M','F'] for id in xrange(2, count): yield return { # 'id':id, 'city':lorem.words(1, common=False), 'country':lorem.words(1, common=False), 'zipcode':'%s' % randint(10000, 60000), 'gender':gender[randint(0,1)], 'birthdate':datetime.now(), 'description':lorem.paragraph(), # 'image':hmmm, }