def get(self): """ Retrieve all episode entries. Filters can be specified in the query string. """ criterions = query.get_query_criterions_from_request(request) sequences = shot_info.get_sequences(criterions) return Entity.serialize_list(sequences)
def get(self, instance_id): """ Retrieve all sequence entries for a given episode. Filters can be specified in the query string. """ criterions = query.get_query_criterions_from_request(request) criterions["parent_id"] = instance_id sequences = shot_info.get_sequences(criterions) return Entity.serialize_list(sequences)
def test_import_shots(self): path = "/data/import/csv/shots" file_path_fixture = self.get_fixture_file_path( os.path.join("csv", "shots.csv")) self.upload_file(path, file_path_fixture) sequences = shot_info.get_sequences() self.assertEqual(len(sequences), 2) shots = shot_info.get_shots() self.assertEqual(len(shots), 3) entity_types = EntityType.query.all() self.assertEqual(len(entity_types), 3)
def prepare_import(self): self.projects = {} self.sequences = {} self.episodes = {} self.shots = {} self.entity_types = {} self.entities = {} self.persons = {} self.departments = {} self.task_types = {} self.task_statuses = {} for project in Project.query.all(): self.projects[project.name] = project for person in Person.query.all(): self.persons[person.first_name + " " + person.last_name] = person for episode in shot_info.get_episodes(): self.episodes[str(episode.project_id) + episode.name] = episode for sequence in shot_info.get_sequences(): self.sequences["%s%s%s" % ( sequence.project_id, sequence.parent_id, sequence.name )] = sequence for shot in shot_info.get_shots(): self.shots["%s%s%s" % ( shot.project_id, shot.parent_id, shot.name )] = shot print(self.shots) for entity_type in EntityType.query.all(): self.entity_types[entity_type.name] = entity_type for entity in Entity.query.all(): self.entities["%s%s%s" % ( entity.project_id, entity.entity_type_id, entity.name )] = entity
def get_sequence_map(self): sequences = shot_info.get_sequences() return {sequence.shotgun_id: sequence.id for sequence in sequences}
def test_get_sequences(self): sequences = shot_info.get_sequences() self.assertDictEqual(sequences[0].serialize(), self.sequence.serialize())