Hi,

On Thu, Apr 23, 2009 at 4:05 PM, davidlmontgomery <
davidlmontgom...@gmail.com> wrote:

>
> I would like to know if there is a consensus on the best
> way to set up and remove sqlalchemy Sessions in django.
>
> I figure I'm either going to use middleware, something like this
> thread:
>
> http://groups.google.com/group/django-users/browse_thread/thread/e6749f7eec1cc46c/ef9d9e27943af830
>
> or I'm going to use signals, something like this post:
>
> http://translate.google.com/translate?hl=en&sl=ja&u=http://d.hatena.ne.jp/perezvon/20071120/1195577831&ei=GeOISeKPA4K2sQOw0c2YBg&sa=X&oi=translate&resnum=2&ct=result&prev=/search%3Fq%3Ddjango%2Bsqlalchemy%2Bwsgi%2Bsessionmaker%26hl%3Den%26rlz%3D1B3GGGL_enUS293US293
>
> Any clear advantages or disadvantages for the two approaches?
>

Personally I find the Middleware approach cleaner and allows you to handle
exceptions with rollbacks as indicated in the django-users thread.  There
was a project Tranquil (http://code.google.com/p/tranquil/) that expanded on
this idea to inject more stuff into the request automatically. It's pretty
much dead at this point from what I understand.
Additionally I'll point out that I have a  project called Django-SQLAlchemy
(http://gitorious.org/projects/django-sqlalchemy) that has the aim of
automatically making SQLAlchemy accessible through Django applications.

Good luck.

-- 
Michael Trier
http://michaeltrier.com/
http://thisweekindjango.com/

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to