1
0
mirror of https://gitlab.crans.org/mediatek/med.git synced 2024-11-26 20:07:09 +00:00
med/media/serializers.py

66 lines
1.5 KiB
Python
Raw Normal View History

2019-08-17 10:12:10 +00:00
from rest_framework import serializers
2020-09-25 08:27:43 +00:00
from .models import Auteur, BD, CD, FutureMedia, Manga, Emprunt, Jeu, Revue, Roman, Vinyle
2019-08-17 10:12:10 +00:00
2020-09-25 08:27:43 +00:00
class AuteurSerializer(serializers.ModelSerializer):
2019-08-17 10:12:10 +00:00
class Meta:
model = Auteur
fields = ['url', 'name']
2020-09-25 08:27:43 +00:00
class BDSerializer(serializers.ModelSerializer):
2019-08-17 10:12:10 +00:00
class Meta:
2020-05-22 16:04:41 +00:00
model = BD
2020-09-25 08:27:43 +00:00
fields = '__all__'
class MangaSerializer(serializers.ModelSerializer):
class Meta:
model = Manga
fields = '__all__'
class CDSerializer(serializers.ModelSerializer):
class Meta:
model = CD
fields = '__all__'
class VinyleSerializer(serializers.ModelSerializer):
class Meta:
model = Vinyle
fields = '__all__'
class RomanSerializer(serializers.ModelSerializer):
class Meta:
model = Roman
fields = '__all__'
class RevueSerializer(serializers.ModelSerializer):
class Meta:
model = Revue
fields = '__all__'
class FutureMediaSerializer(serializers.ModelSerializer):
class Meta:
model = FutureMedia
fields = '__all__'
2019-08-17 10:12:10 +00:00
class EmpruntSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Emprunt
fields = ['url', 'media', 'user', 'date_emprunt', 'date_rendu',
'permanencier_emprunt', 'permanencier_rendu']
class JeuSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Jeu
fields = ['url', 'name', 'proprietaire', 'duree', 'nombre_joueurs_min',
'nombre_joueurs_max', 'comment']