openbackloggery/collection/games/serializers.py

33 lines
747 B
Python

from games.models import Game
from games.models import Platform
from games.models import Timeline
from rest_framework import serializers
class GameSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Game
fields = (
'collection',
'name',
'note',
'playing',
'status',
'unplayed',
'wish', )
class GameTimelineSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Timeline
fields = (
'date',
'item',
'status', )
class PlatformSerializer(serializers.ModelSerializer):
class Meta:
model = Platform
fields = ('name', 'shortname')