I know this has been asked before but I've searched around and can't
find a complete solution.

I'm trying to setup a single turbogears application that will host a
number of other "applications" each with their own databases.  I'm
using Elixir and have a simple sqlite database for Identity. I want to
use Elixir to manage the models of all the other databases too, but I
can't get it to work right.

>From other posts I figured out how to have my elixir objects use a
specific metadata (ie using_options(metadata=...))
and I've managed to be able to access two different databases at the
same time this way.

But the session object is only connected to the default model that was
created in model.py I can't seem to be able to make it update the
database for any other models in my application.

I can create a bunch of objects OK and even retrieve objects if they
are already in the database, but I can't session.flush() and have the
changes committed to the database.

I'm probably doing it completely wrong so here is what I'd like to
know how to do.

1. specify in the configuration file url_one = "sqlite:\\\db1.sqlite"
and url_two = "sqlite:\\\db2.sqlite"

2. have seperate model definition files model_one.py, model_two.py

3. attach model_one's metadata to url_one and model_two's metadata to
url_two

4. have Elixir's create_all() function create the database tables in
the database associated with the url
   (when necessary during development)

5. in a controller be able to access both models, create instances,
select objects from the database backends and commit changes to the
database.

6. ideally I'd like to be able to specify that any required session
objects are setup before entering an @exposed controller method and
changes commited if required on exit.


--~--~---------~--~----~------------~-------~--~----~
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