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