mirror of
https://gitlab.crans.org/mediatek/med.git
synced 2024-11-26 18:07:10 +00:00
65 lines
1.3 KiB
Python
65 lines
1.3 KiB
Python
from rest_framework import serializers
|
|
|
|
from .models import Author, Borrow, CD, Comic, FutureMedium, Manga, Game, \
|
|
Novel, Review, Vinyl
|
|
|
|
|
|
class AuthorSerializer(serializers.ModelSerializer):
|
|
class Meta:
|
|
model = Author
|
|
fields = ['url', 'name']
|
|
|
|
|
|
class ComicSerializer(serializers.ModelSerializer):
|
|
class Meta:
|
|
model = Comic
|
|
fields = '__all__'
|
|
|
|
|
|
class MangaSerializer(serializers.ModelSerializer):
|
|
class Meta:
|
|
model = Manga
|
|
fields = '__all__'
|
|
|
|
|
|
class CDSerializer(serializers.ModelSerializer):
|
|
class Meta:
|
|
model = CD
|
|
fields = '__all__'
|
|
|
|
|
|
class VinylSerializer(serializers.ModelSerializer):
|
|
class Meta:
|
|
model = Vinyl
|
|
fields = '__all__'
|
|
|
|
|
|
class NovelSerializer(serializers.ModelSerializer):
|
|
class Meta:
|
|
model = Novel
|
|
fields = '__all__'
|
|
|
|
|
|
class ReviewSerializer(serializers.ModelSerializer):
|
|
class Meta:
|
|
model = Review
|
|
fields = '__all__'
|
|
|
|
|
|
class FutureMediumSerializer(serializers.ModelSerializer):
|
|
class Meta:
|
|
model = FutureMedium
|
|
fields = '__all__'
|
|
|
|
|
|
class BorrowSerializer(serializers.HyperlinkedModelSerializer):
|
|
class Meta:
|
|
model = Borrow
|
|
fields = '__all__'
|
|
|
|
|
|
class GameSerializer(serializers.HyperlinkedModelSerializer):
|
|
class Meta:
|
|
model = Game
|
|
fields = '__all__'
|