openbackloggery/collection/games/serializers.py

33 lines
747 B
Python
Raw Permalink Normal View History

2018-01-15 18:06:26 +00:00
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',
2018-01-15 18:06:26 +00:00
'wish', )
2017-09-16 22:04:26 +00:00
class GameTimelineSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Timeline
fields = (
'date',
'item',
2018-01-15 18:06:26 +00:00
'status', )
2017-09-16 22:04:26 +00:00
class PlatformSerializer(serializers.ModelSerializer):
class Meta:
model = Platform
2018-01-15 18:06:26 +00:00
fields = ('name', 'shortname')