Ok, got my model building tables and selecting, but not the way the wiki
doc said. ;-) I had to add into the __init__.py file

from page import *

and then the paster setup-app command would work. Otherwise it wants to
build from __init__.py, unless the user edits websetup.py, and that
thing is somewhat confusing so I don't think we want a user to have to
do that, correct?

Onwards:

I'm in favour of the choice of raw sa0.4 as the default orm, but I would
like to bring up the possibility of having scoped_session as the default
engine session. ( or is that already the plan? )

I think to most people coming to TG this:

page = Page.query.get_by(pagename=pagename)

is a lot more attractive than this:

page = DBSession.query(Page).filter_by(pagename=pagename).one()

I got the scoped session behaviour working by ( redundantly? ) putting
this in my model/page.py file:

DBSession = scoped_session(sessionmaker(autoflush=True,
transactional=True))
mapper = DBSession.mapper

Is that planned to be the default behaviour? Could it be? I personally
wish the SA docs made it a little easier to find that behaviour too. It
would also mean that the tutorials can look more like our existing
assign_mapper tutorials and most of the time people coming from tg1 and
sa0.3 will only have to remember to stick a 'query' in there. But maybe
I'm missing something important here?

Thanks
iain



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears Trunk" 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-trunk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to