2009/12/16 César Fernández Rodríguez <[email protected]>:
> Hi everyone,
>
> i'm trying to use elixir in turbogears, i have a simple model working
> with qt4, but i want to use it through the web also.
>
> I've made a little test, but i think that i have to change something in
> the package model, in the file __init__.py. Do i need to change the
> whole file or can i use the stuff within?
>
> Another thing, the bind data, can i use directly from the
> config['pylons.app_globals'].sa_engine as sqlalchemy does?

I see no reason you could not.

> If anyone has a sample __init__.py file and a simple model that works
> i'll be very thankful, because the rest of the things, i think, will be
> the same as in my qt4 application.

Sorry, I never used TG2, so I don't have that but you should be able
to copy what is done for SQLAlchemy, except for a few points:

- you need to call setup_all() after your models have been defined/imported.
- *if* you use elixir default session and you might need to configure
it to suit your needs, otherwise you have to tell elixir which session
you are using (or set it to None if you don't want a scoped session).
- same comment for elixir's default metadata.

> I'll try a couple of things and if i cannot manage to get a simple CRUD
> model in turbogears with elixir i'll use sqlalchemy definitions, but a
> direct translation would be perfect for future apps.

-- 
Gaëtan de Menten
http://openhex.org

--

You received this message because you are subscribed to the Google Groups 
"SQLElixir" 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/sqlelixir?hl=en.


Reply via email to