diff --git a/game/api/v1/serializers.py b/game/api/v1/serializers.py index 7b2ef01..5010f1b 100644 --- a/game/api/v1/serializers.py +++ b/game/api/v1/serializers.py @@ -22,9 +22,7 @@ class GetHeroSerializer(serializers.ModelSerializer): fields = ( "added", "type", - "idle_img", - "attack_img", - "die_img", + "model", "health", "attack", "speed", @@ -37,9 +35,7 @@ class ListHeroSerializer(serializers.ModelSerializer): fields = ( "uuid", "type", - "idle_img", - "attack_img", - "die_img", + "model", "health", "attack", "speed", diff --git a/game/models.py b/game/models.py index 222caff..9e2c859 100644 --- a/game/models.py +++ b/game/models.py @@ -117,15 +117,7 @@ class Hero(models.Model): def save( self, force_insert=False, force_update=False, using=None, update_fields=None ): - self.idle_img_f = random.choice( - [x for x in HeroModelSet.objects.filter(hero_type=self.type)] - ) - self.attack_img_f = random.choice( - [x for x in HeroModelSet.objects.filter(hero_type=self.type)] - ) - self.die_img_f = random.choice( - [x for x in HeroModelSet.objects.filter(hero_type=self.type)] - ) + self.model_f = random.choice(HeroModelSet.objects.filter(hero_type=self.type)) super(Hero, self).save() class Meta: