コード例 #1
0
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')
コード例 #2
0
class GenreSerializer(serializers.ModelSerializer):

    artist_set = ArtistEmbedGenreSerializer(many=True)
    metaData = MetaDataSerializer()

    class Meta:
        model = Genre
        fields = ('id',
                  'name',
                  'artist_set',
                  'description',
                  'metaData')
コード例 #3
0
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'
        }
コード例 #4
0
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')
コード例 #5
0
class FlierSerializer(serializers.ModelSerializer):

    show = ShowEmbedMediaSerializer()
    metaData = MetaDataSerializer()

    class Meta:
        model = Flier
        fields = ('id',
                  'image',
                  'date',
                  'caption',
                  'year_month',
                  'date_string',
                  'show',
                  'metaData')
コード例 #6
0
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')
コード例 #7
0
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')
コード例 #8
0
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')