picture = random.choice(puppy_images) description = random.choice(puppy_descriptions) return PuppyProfile(picture=picture, description=description) #This will check a puppy in to a random shelter def CheckInToRandomShelter(puppy): shelter_id = randint(1,5) session.query(Shelter).filter(Shelter.id == shelter_id).one().checkIn(puppy) # Create puppies and wither have adopted or check in to random shelter for i,x in enumerate(male_names): new_puppy = Puppy(name = x, gender = "male", dateOfBirth = CreateRandomAge(), weight= CreateRandomWeight(),profile=CreateRandomProfile()) session.add(new_puppy) if randint(0,1): new_puppy.adopt(random.choice(adopters), random.choice(adopters)) else: CheckInToRandomShelter(new_puppy) session.commit() for i,x in enumerate(female_names): new_puppy = Puppy(name = x, gender = "female", dateOfBirth = CreateRandomAge(), weight= CreateRandomWeight(),profile=CreateRandomProfile()) session.add(new_puppy) if randint(0,1): new_puppy.adopt(random.choice(adopters), random.choice(adopters)) else: CheckInToRandomShelter(new_puppy) session.commit() # Create an unoccupied shelter