hey pylonistas -

any chance this verbiage can be changed ?

http://pylonshq.com/docs/quick_wiki.html

import sqlalchemy.mods.threadlocal
from sqlalchemy import *

   <other stuff>

"The first two lines setup SQLAlchemy to support threads and import  
some useful objects such as the Table and Column classes. "

While this line may seem harmless, I think people are getting fairly  
mislead by that; SQLAlchemy can be used in a threaded environment  
with or without the usage of the threadlocal mod.  more importantly,  
turning on the "threadlocal" mod greatly modifies the behavior of  
sqlalchemy in such a way as to be incompatible with most of the basic  
sqlalchemy examples on the SA site, including the tutorial...and  
twice this week i have had people trying to mix it up with explicit  
session usage, which causes a behavior that is extremely confusing if  
you dont understand what "threadlocal" actually does, which is that  
it automatically associates new instances with an implicitly created  
session (thereby creating a conflict when you try to save() your new  
instance elsewhere).

the "threadlocal" mod was meant primarily as a migration path from  
the 0.1 series where such behavior was the default, and should  
probably not even be used for new projects, in favor of the  
sessioncontext plugin which is more generic and less magical.   
sessioncontext is more explicit, and compared to threadlocal fits  
well into the "explicit is better than implicit" idea.

even better would be to keep threadlocal/sessioncontext out of the  
tutorials altogether, sticking to basic explicit session usage and  
leaving the usage of those plugins to those who have read and  
understood the documentation on the SA site.  (that or, build a  
contextual session into Pylons the way the turbogears folks do, so  
that theres a single pattern of SA session usage within Pylons which  
is unique to Pylons and wont as easily be confused with generic SA  
session usage).

oh and p.s., download myghty 1.1 ! :)



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" 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/pylons-discuss
-~----------~----~----~----~------~----~------~--~---

Reply via email to