示例#1
0
 def map_dbal_to_domain(self, dbal_model):
     return MusicRating(
         entity_id=encode_id.music_rating(dbal_model.id),
         artist_id=encode_id.artist(dbal_model.artist_id),
         album_id=encode_id.genre(dbal_model.album_id),
         track_id=encode_id.genre(dbal_model.track_id),
         created_at=dbal_model.created_at,
         updated_at=dbal_model.updated_at,
         rating=dbal_model.rating,
     )
 def map_dbal_to_domain(self, dbal_model):
     return Artist(
         entity_id=encode_id.artist(dbal_model.id),
         name=dbal_model.name,
         type_=dbal_model.artist_type,
         genre_id=encode_id.genre(dbal_model.genre_id),
     )
示例#3
0
 def map_dbal_to_domain(self, dbal_model):
     return Album(
         entity_id=encode_id.album(dbal_model.id),
         name=dbal_model.name,
         artist_id=encode_id.artist(dbal_model.artist_id),
         genre_id=encode_id.genre(dbal_model.genre_id),
     )
示例#4
0
 def map_dbal_to_domain(self, dbal_model):
     return Genre(
         entity_id=encode_id.genre(dbal_model.id),
         name=dbal_model.name,
     )
示例#5
0
def genre_entity():
    return Genre(
        entity_id=encode_id.genre(1),
        name='Rock',
    )