chess_rpg_backend/game/serializers.py

24 lines
526 B
Python

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",
)