diff --git a/src/character/migrations/0014_remove_character_mana_consumed_and_more.py b/src/character/migrations/0014_remove_character_mana_consumed_and_more.py new file mode 100644 index 0000000..75da308 --- /dev/null +++ b/src/character/migrations/0014_remove_character_mana_consumed_and_more.py @@ -0,0 +1,24 @@ +# Generated by Django 4.1.2 on 2022-10-30 16:45 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("character", "0013_character_money_pa_character_money_pc_and_more"), + ] + + operations = [ + migrations.RemoveField( + model_name="character", + name="mana_consumed", + ), + migrations.AddField( + model_name="character", + name="mana_remaining", + field=models.PositiveSmallIntegerField( + default=0, verbose_name="mana restant" + ), + ), + ] diff --git a/src/character/migrations/max_migration.txt b/src/character/migrations/max_migration.txt index eea0192..2c6ec14 100644 --- a/src/character/migrations/max_migration.txt +++ b/src/character/migrations/max_migration.txt @@ -1 +1 @@ -0013_character_money_pa_character_money_pc_and_more +0014_remove_character_mana_consumed_and_more diff --git a/src/character/models/character.py b/src/character/models/character.py index 0999202..8aba072 100644 --- a/src/character/models/character.py +++ b/src/character/models/character.py @@ -129,8 +129,8 @@ class Character(models.Model): verbose_name="points de chance restants" ) - mana_consumed = models.PositiveSmallIntegerField( - default=0, verbose_name="mana utilisé" + mana_remaining = models.PositiveSmallIntegerField( + default=0, verbose_name="mana restant" ) money_pp = models.PositiveSmallIntegerField(default=0, verbose_name="PP") @@ -219,10 +219,6 @@ class Character(models.Model): def mana_max(self) -> int: return 2 * self.level + self.modifier_intelligence - @property - def mana_remaining(self) -> int: - return self.mana_max - self.mana_consumed - @property def height_m(self) -> float: return round(self.height / 100, 2) diff --git a/src/character/templates/character/view.html b/src/character/templates/character/view.html index 185d3db..b78e730 100644 --- a/src/character/templates/character/view.html +++ b/src/character/templates/character/view.html @@ -135,8 +135,36 @@