Am 17.11.2011 17:56, schrieb Brad Holden:
Below are the model.py, the archivemodel.py, the __init__.py and the dev.cfg

> sqlalchemy.dburi="sqlite:///Users/holden/tg1p1env/devdata.sqlite"
> archive.dburi="postgresql://holden:password@localhost/datareduc"

> mod_engine = create_engine("sqlite:////Users/holden/tg1p1env/tg1dreduce/devdata.sqlite", echo=True)
> mod_session = scoped_session(sessionmaker(autoflush=True))
> mod_metadata = ThreadLocalMetaData()

That looks wrong. First, why do you specify the same URIs in two places, the config and the model file? Second, you're not using the engine anywhere, you don't bind your metadata to the engine.

I never used Elixir, but as far as I understand, you can just use the model files created by quickstart, and only change the line

options_defaults.update(autosetup=False,
     metadata=metadata, session=session)

for your second database to

options_defaults.update(autosetup=False,
    metadata=get_metadata('archive'), session=session)

The names metadata, get_metadata and session should be imported from tg.database.

-- Christoph

--
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en.

Reply via email to