Ejemplo n.º 1
0
    def run(self):
        faker = Faker(
            cls=User,
            init={
                'first_name':
                generator.Name(),
                'second_name':
                generator.Name(),
                'last_name':
                generator.Name(),
                'date_of_birth':
                generators.DateTime(start_date=date_of_birth_start,
                                    end_date=date_of_birth_end),
                'user_name':
                generators.Username(user_names=random_user_names),
                'email':
                generators.Email(first_names=random_first_names,
                                 last_names=random_last_names),
                'password':
                generators.GenericListItem(generic_list=rock_solid_passwords),
                'id':
                generators.RelationalPrimaryKey(user_uuids_container)
            })

        # Create 5 users
        for user in faker.create(user_uuids_container.container_list_length()):
            print("Adding user: %s" % user)
            self.db.session.add(user)
Ejemplo n.º 2
0
    def run(self):
        faker = Faker(
            cls=GpsPoint,
            init={
                'spotId':
                generators.RelationalForeignKey(spot_uuids_container),
                'lat': generators.GenericListItem(gps_lat_lon),
                'lon': generators.GenericListItem(gps_lat_lon),
                'id': generators.RelationalPrimaryKey(gps_uuids_container)
            })

        for gps in faker.create(gps_uuids_container.container_list_length()):
            print("Adding gps: %s" % gps)
            self.db.session.add(gps)
Ejemplo n.º 3
0
    def run(self):
        faker = Faker(
            cls=Spot,
            init={
                'missionId':
                generators.RelationalForeignKey(mission_uuids_container),
                'observationQualityCode':
                generators.GenericListItem(generic_list=obs_quality_codes),
                'observationDateTime':
                generators.DateTime(start_date=obs_date_start,
                                    end_date=obs_date_end),
                'id':
                generators.RelationalPrimaryKey(spot_uuids_container)
            })

        for spot in faker.create(spot_uuids_container.container_list_length()):
            print("Adding spot: %s" % spot)
            self.db.session.add(spot)
Ejemplo n.º 4
0
    def run(self):
        faker = Faker(
            cls=Mission,
            init={
                'userId':
                generators.RelationalForeignKey(user_uuids_container),
                'parcSection':
                generators.GenericListItem(generic_list=parc_sections),
                'timeStamp':
                generators.DateTime(start_date=d1, end_date=d2),
                'id':
                generators.RelationalPrimaryKey(mission_uuids_container)
            })

        for mission in faker.create(
                mission_uuids_container.container_list_length()):
            print("Adding mission: %s" % mission)
            self.db.session.add(mission)
Ejemplo n.º 5
0
    def run(self):
        faker = Faker(
            cls=Observation,
            init={
                'spotId':
                generators.RelationalForeignKey(spot_uuids_container),
                'animalName': generator.Name(),
                'sex': generators.GenericListItem(sex_enum),
                'age': generators.GenericListItem(age_enum),
                'pregnancyGrade':
                generators.GenericListItem(pregnancy_grade_enum),
                'id':
                generators.RelationalPrimaryKey(observation_uuids_container)
            })

        for observation in faker.create(
                observation_uuids_container.container_list_length()):
            print("Adding observation: %s" % observation)
            self.db.session.add(observation)