class ArtistSerializer(serializers.ModelSerializer): photos = PhotoEmbedArtistSerializer(many=True) videos = VideoEmbedArtistSerializer(many=True) genres = EmbedGenreSerializer(many=True) show_set = ShowEmbedMusicSerializer(many=True) metaData = MetaDataSerializer() class Meta: model = Artist fields = ('id', 'name', 'hometown', 'genres', 'bandcamp', 'facebook', 'soundcloud', 'youtube', 'description', 'soundcloud_embed_code', 'youtube_embed_code', 'bandcamp_embed_code', 'show_set', 'metaData', 'photos', 'videos')
class GenreSerializer(serializers.ModelSerializer): artist_set = ArtistEmbedGenreSerializer(many=True) metaData = MetaDataSerializer() class Meta: model = Genre fields = ('id', 'name', 'artist_set', 'description', 'metaData')
class HistorySerializer(serializers.ModelSerializer): artists = ArtistSerializer(many=True) shows = ShowSerializer(many=True) metaData = MetaDataSerializer() class Meta: model = History fields = { 'image', 'image_caption', 'title', 'text', 'artists', 'shows', 'start_or_primary_date', 'end_date', 'metaData' }
class ShowSerializer(serializers.ModelSerializer): flier = FlierSerializer() artists = ArtistSerializer(many=True) photos = PhotoSerializer(many=True) videos = YoutubeSerializer(many=True) metaData = MetaDataSerializer() class Meta: model = Show fields = ('id', 'date', 'time', 'suggested_donation', 'suggested_donation_max', 'description', 'facebook', 'instagram', 'year_month', 'date_string', 'artists', 'photos', 'videos', 'genres', 'sorted_genres', 'flier', "name", 'metaData', 'cancelled')
class FlierSerializer(serializers.ModelSerializer): show = ShowEmbedMediaSerializer() metaData = MetaDataSerializer() class Meta: model = Flier fields = ('id', 'image', 'date', 'caption', 'year_month', 'date_string', 'show', 'metaData')
class YoutubeSerializer(serializers.ModelSerializer): artist = ArtistSerializer() show = ShowEmbedMediaSerializer() metaData = MetaDataSerializer() class Meta: model = YoutubeVideo fields = ('id', 'date', 'youtube_url', 'caption', 'year_month', 'date_string', 'artist', 'show', 'metaData')
class PhotoSerializer(serializers.ModelSerializer): artist = ArtistSerializer() show = ShowEmbedMediaSerializer() metaData = MetaDataSerializer() class Meta: model = Photo fields = ('id', 'image', 'date', 'caption', 'year_month', 'date_string', 'artist', 'show', 'metaData')
class AlbumSerializer(serializers.ModelSerializer): genres = GenreSerializer(many=True) artist = ArtistSerializer() metaData = MetaDataSerializer() class Meta: model = Album fields = ('id', 'name', 'genres', 'release_date', 'bandcamp', 'youtube', 'artist', 'cover_image', 'description', 'youtube_embed_code', 'bandcamp_embed_code', 'metaData')