From ba0e66f9af4ca2834e5b574daa607206ff2da4e1 Mon Sep 17 00:00:00 2001 From: evilchili Date: Sun, 18 Feb 2024 19:30:41 -0800 Subject: [PATCH] modeling many-to-many relationships --- ttfrog/assets/templates/character_sheet.html | 19 ++- ttfrog/db/base.py | 27 +++- ttfrog/db/bootstrap.py | 58 ++++--- ttfrog/db/schema.py | 141 ------------------ ttfrog/db/schema/__init__.py | 4 + ttfrog/db/schema/character.py | 91 +++++++++++ ttfrog/db/schema/classes.py | 43 ++++++ ttfrog/db/schema/property.py | 46 ++++++ ttfrog/db/schema/transaction.py | 14 ++ .../webserver/controllers/character_sheet.py | 18 +-- ttfrog/webserver/controllers/json_data.py | 25 ++++ ttfrog/webserver/forms.py | 5 +- 12 files changed, 307 insertions(+), 184 deletions(-) delete mode 100644 ttfrog/db/schema.py create mode 100644 ttfrog/db/schema/__init__.py create mode 100644 ttfrog/db/schema/character.py create mode 100644 ttfrog/db/schema/classes.py create mode 100644 ttfrog/db/schema/property.py create mode 100644 ttfrog/db/schema/transaction.py create mode 100644 ttfrog/webserver/controllers/json_data.py diff --git a/ttfrog/assets/templates/character_sheet.html b/ttfrog/assets/templates/character_sheet.html index da20632..5b68859 100644 --- a/ttfrog/assets/templates/character_sheet.html +++ b/ttfrog/assets/templates/character_sheet.html @@ -15,7 +15,12 @@
{{ field('name') }} - {{ field('ancestry') }} {{ c.record.character_class|join(' / ') }}   Level {{ field('level') }} + {{ field('ancestry') }} + {% for rec in c.record.classes %} + {{ rec.character_class.name }} {{ rec.level }} + {% endfor %} + + {{ c.record.character_class|join(' / ') }}  
{{ c.form.save }}   {{ c.form.delete }}
@@ -135,6 +140,14 @@
+
+
Attributes
+ +
Defenses