On Tuesday, July 23, 2013 2:52:32 AM UTC-4, Laurence Rowe wrote:
>
> I've not used the scaffold myself, but invalidation is handled by 
> zope.sqlalchemy which ties SQLAlchemy into Pyramid's request lifecycle with 
> pyramid_tm.
>

i didn't realize that pyramid_tm was in the environment.ini; thanks.
 

> I don't really understand the purpose of this recipe. 
>

the cookbook and mine do the same thing.  cookbook edits `config`, i used a 
tween.  it just stashes a new `db` session on the request object , and 
simultaneously registers a cleanup to roll it back.  if you're not using 
transaction, you need to do stuff like that. 

 

> I do prefer the ``session = DBSession()`` pattern myself. The SQLAlchemy 
> docs consistently refer to the scoped session factory as capitalized 
> ``Session`` and the thread local session as lowercased ``session``. I think 
> sticking fairly closely with the conventions from SQLAlchemy docs is 
> worthwhile so don't see the point in changing to ``local_session = 
> DBSessionFactory()``.  The Session -> DBSession naming is probably 
> worthwhile to avoid confusion with Pyramid's completely unrelated 
> request.session.
>

The SqlAlchemy docs and namespace are great for people who are coming to 
this from a Database perspective.  Many people won't both reading them 
until they're knee deep in playing with pyramid.  , and the `Session` vs 
`session` difference can be troubling.

People considering Pyramid over Django/Flask/etc can ( and do ) get 
confused with that completely unrelated request.session .

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pylons-devel+unsubscr...@googlegroups.com.
To post to this group, send email to pylons-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/pylons-devel.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to