openbackloggery/collection/games/serializers.py

33 lines
703 B
Python
Raw Normal View History

2017-09-16 22:04:26 +00:00
from games.models import Game, Platform, Timeline
from rest_framework import serializers
class GameSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Game
fields = (
'collection',
'name',
'note',
'playing',
'status',
'unplayed',
'wish',
)
2017-09-16 22:04:26 +00:00
class GameTimelineSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Timeline
fields = (
'date',
'item',
'status',
)
class PlatformSerializer(serializers.ModelSerializer):
class Meta:
model = Platform
fields = ('name',)