This is a great idea. A few suggestions to make it maybe easier for folks to understand:
Do the initial table setup use plain SQL statements - i.e using db.q(). That way, it's more obvious I think what's going on, and you don't need the del stuff and explanation
Before you do any of the globals() stuff, show how to manually use db.t. and dataclass to dynamically get the table objects and classes
Then finally at the end explain that can be automated.
This is a great idea. A few suggestions to make it maybe easier for folks to understand:
db.q()
. That way, it's more obvious I think what's going on, and you don't need thedel
stuff and explanationglobals()
stuff, show how to manually usedb.t.
anddataclass
to dynamically get the table objects and classes