From 6f392a46038037e45d9ca115ef3f3854b7445d97 Mon Sep 17 00:00:00 2001 From: Gabriel Augendre Date: Sun, 30 Oct 2022 16:51:17 +0100 Subject: [PATCH] Add money + display notes --- ...er_money_pa_character_money_pc_and_more.py | 33 +++++++++++++++++++ src/character/migrations/max_migration.txt | 2 +- src/character/models/character.py | 5 +++ src/character/templates/character/view.html | 12 ++++++- 4 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 src/character/migrations/0013_character_money_pa_character_money_pc_and_more.py diff --git a/src/character/migrations/0013_character_money_pa_character_money_pc_and_more.py b/src/character/migrations/0013_character_money_pa_character_money_pc_and_more.py new file mode 100644 index 0000000..947a39c --- /dev/null +++ b/src/character/migrations/0013_character_money_pa_character_money_pc_and_more.py @@ -0,0 +1,33 @@ +# Generated by Django 4.1.2 on 2022-10-30 15:44 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("character", "0012_alter_capability_options_alter_character_options_and_more"), + ] + + operations = [ + migrations.AddField( + model_name="character", + name="money_pa", + field=models.PositiveSmallIntegerField(default=0, verbose_name="PA"), + ), + migrations.AddField( + model_name="character", + name="money_pc", + field=models.PositiveSmallIntegerField(default=0, verbose_name="PC"), + ), + migrations.AddField( + model_name="character", + name="money_po", + field=models.PositiveSmallIntegerField(default=0, verbose_name="PO"), + ), + migrations.AddField( + model_name="character", + name="money_pp", + field=models.PositiveSmallIntegerField(default=0, verbose_name="PP"), + ), + ] diff --git a/src/character/migrations/max_migration.txt b/src/character/migrations/max_migration.txt index 5ec1842..eea0192 100644 --- a/src/character/migrations/max_migration.txt +++ b/src/character/migrations/max_migration.txt @@ -1 +1 @@ -0012_alter_capability_options_alter_character_options_and_more +0013_character_money_pa_character_money_pc_and_more diff --git a/src/character/models/character.py b/src/character/models/character.py index 0aab841..0999202 100644 --- a/src/character/models/character.py +++ b/src/character/models/character.py @@ -133,6 +133,11 @@ class Character(models.Model): default=0, verbose_name="mana utilisé" ) + money_pp = models.PositiveSmallIntegerField(default=0, verbose_name="PP") + money_po = models.PositiveSmallIntegerField(default=0, verbose_name="PO") + money_pa = models.PositiveSmallIntegerField(default=0, verbose_name="PA") + money_pc = models.PositiveSmallIntegerField(default=0, verbose_name="PC") + notes = models.TextField(blank=True, verbose_name="notes") objects = CharacterManager() diff --git a/src/character/templates/character/view.html b/src/character/templates/character/view.html index 1fb146a..f651523 100644 --- a/src/character/templates/character/view.html +++ b/src/character/templates/character/view.html @@ -156,10 +156,16 @@

{{ character.equipment|linebreaksbr|default:"Rien ici..." }}

+ -
Voies & Capacités
+

Voies & Capacités

{% for path, capabilities in character.get_capabilities_by_path.items %}
@@ -185,4 +191,8 @@
{% endfor %}
+

Notes

+
+ {{ character.notes|linebreaks }} +
{% endblock %}