Relative Content

Tag Archive for python-3.xsqlalchemy

Lazily importing modules on SQLAlchemy

In SQL Alchemy, I have quite a few tables in my database defined. Strangely, every time I want to access an element on that database I have to import the element in the file. It feels wrong (I come from a Perl background and the imports are done lazily in the table file). I tried adding the things meant to be imported into the file with the base table definition, but that results in a cyclic loop apparently and fails to start. Is there something I’m missing? I’ll include a basic example of what the table definitions look like, and how I’m accessing the objects below. (I didn’t create the database, I’m just creating a new system to access it)

Importing modules on SQL Alchemy

In SQL Alchemy, I have quite a few tables in my database defined. Strangely, every time I want to access an element on that database I have to import the element in the file. It feels wrong (I come from a Perl background and the imports are done lazily in the table file). I tried adding the things meant to be imported into the file with the base table definition, but that results in a cyclic loop apparently and fails to start. Is there something I’m missing? I’ll include a basic example of what the table definitions look like, and how I’m accessing the objects below. (I didn’t create the database, I’m just creating a new system to access it)