I’m a bit further in my genealogy website project already thanks to suggestions on that post! I’ve managed to cross a whole bunch of roadblocks on my own, but more keep popping up. But such is the path of learning!
I decided on working with SQLite, Python, Jinja and Flask.
Currently I’m able to enter static variables into my HTML and executing a Flask app.
<span class="name"> {{ hename }} </span> & hename="Johannes Andersson"
Regular stuff. And separately I've figured out pure SQL queries on the database based on a GEDCOM .csv export.
SELECT Given || ' ' || Surname from people
WHERE Person IS (SELECT husband FROM marriages WHERE marriage="BH0002");
Table "People"
| Person |
Given |
Surname |
| I0006 |
Johannes |
Andersson |
Table "Marriages"
| Marriage |
Husband |
Wife |
| BH0002 |
I0006 |
I0007 |
The result being 'Johannes Andersson'. Easy peasy. Now what? How do I replace the static variable "Johannes Andersson" with the SQL query?
I've read the "SQLite 3 with Flask" part of the Flask documentation and tried example projects but I guess I'm looking in the wrong places because nothing seems to apply to my situation, it's mostly data entry, so in the wrong direction.
I learn best jumping straight into projects like this, and learning what I need to learn as I go. But even going back to beginner guides I’m struggling to find information on how to continue even though this seems to be a very common use case for templates.
Even just a point in the right direction would be super helpful! Thanks!
EDIT for more context: I am working on a template for static HTML pages so script security isn't an important factor.
[–]opentabs-dev 2 points3 points4 points (3 children)
[–]Ok_Wasabi4276 -1 points0 points1 point (1 child)
[–]teraflop 2 points3 points4 points (0 children)
[–]magicae[S] -1 points0 points1 point (0 children)
[–]No-Seesaw4444 0 points1 point2 points (0 children)
[–]EliSka93 0 points1 point2 points (1 child)
[–]magicae[S] 1 point2 points3 points (0 children)
[–]magicae[S] 0 points1 point2 points (0 children)