On Mon, Sep 6, 2010 at 11:46 AM, eka <[email protected]> wrote:

> The tutorials I have found use DeclarativeBase. I found information in
> the SQLAlchemy docs about how to explicitly define the class, table
> and mapper. It would be great to see how this separation of model and
> persistence is integrated into Turbogears2.
>

Go for it. It's quite easy to do, and there's no reason not to do so. The
tutorials use DeclarativeBase as that is normally much easier to deal with
for most people. Less code, more visually pleasing.

E.g. when I got to the stage where the database tables need to be
> created I used:  metadata.create_all(engine)
> But I could not get hold of Turbogears engine instance, so I created
> my own!
>

If you were following the tutorials, then you would have found the engine at
myproject.model in the __init__.py file, named, strangely enough, "engine".


> I also wonder if someone has separated the database stuff into a
> package separate from the model package.
>

Some have, I'm sure. I've considered it from time to time myself, but never
found a solid enough need to do so. It shouldn't be very hard, though.

-- 
Michael J. Pedersen
My IM IDs: Jabber/[email protected], ICQ/103345809, AIM/pedermj022171
          Yahoo/pedermj2002, MSN/[email protected]

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