chess_rpg_backend/game/serializers.py

24 lines
526 B
Python
Raw Normal View History

2022-06-04 19:30:54 +03:00
from rest_framework import serializers
from game.models import Hero
class CreateHeroSerializer(serializers.ModelSerializer):
class Meta:
model = Hero
fields = ("type", "idle_img", "attack_img", "die_img", "health", "speed")
class GetHeroSerializer(serializers.ModelSerializer):
class Meta:
model = Hero
fields = (
"added",
"type",
"idle_img",
"attack_img",
"die_img",
"health",
"speed",
)