if you want to go all crazytime...
have a routine in meta.py that figures out all the classes in the
modules that you load, and assign the orm/mapper stuff into class
variables
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
On Oct 12, 1:38 pm, Dan06 wrote:
> Is it better to reflect and map the tables in the meta.py file or just
> create the engine, meta data, and the session in the meta file and
> have each model file reflect and map its respective table? An example
> of the latter follows:
I would recommend someth
Is it better to reflect and map the tables in the meta.py file or just
create the engine, meta data, and the session in the meta file and
have each model file reflect and map its respective table? An example
of the latter follows:
# meta.py
from sqlalchemy import schema, engine, orm
pg_db = engi
sqlalchemy calls the behavior you're looking for 'reflecting'
a pylons -- or non-pylons -- approach to handling this might be such
( old sqlalchemy 4 code ):
1. have a 'meta' module, that has code like this:
from model import *
engine = sqlalchemy.create_engine('postgres://app:a...@loc
On Oct 7, 9:46 am, Dan06 wrote:
> I've recently started pylons, and I've put together some practice
> code. However, I'm unclear on how pylons models should be constructed
> and I'm unsure if I've correctly used sqlalchemy. My practice code has
> 2 relevant files, books_meta.py (model) and books.
I've recently started pylons, and I've put together some practice
code. However, I'm unclear on how pylons models should be constructed
and I'm unsure if I've correctly used sqlalchemy. My practice code has
2 relevant files, books_meta.py (model) and books.py (controller),
which you'll find below.