On Nov 22, 2010, at 4:33 AM, Torsten Landschoff wrote:

> Hi again!
> 
> This questions can probably only be answered by one of the developers of
> SQLAlchemy.
> 
> I need to store information that is valid for the whole session in a
> sane place, together with accessor methods. I ended up extending the
> orm.Session class and passing my class via class_=MySession to the
> sessionmaker.
> 
> Originally I added only 2 fields and 4 methods to the Session but it
> seems like this will grow a bit. Is it okay to add a whole bunch of
> methods to my Session class? Any hints how to avoid name clashes for
> future SQLAlchemy versions?

yeah there's no magic bullet here, you can add as many methods as you like and 
each one raises the chance of a future collision by a tiny amount.  We don't 
add too many methods to Session so its not terribly dangerous, but you could 
consider building a Session facade of your own which delegates to the "real" 
Session internally.  If I were really adding a comprehensive business-centric 
persistence layer I'd almost certainly do that.




> 
> Greetings, Torsten
> 
> -- 
> DYNAmore Gesellschaft fuer Ingenieurdienstleistungen mbH
> Torsten Landschoff
> 
> Office Dresden
> Tel: +49-(0)351-4519587
> Fax: +49-(0)351-4519561
> 
> mailto:[email protected]
> http://www.dynamore.de
> 
> Registration court: Mannheim, HRB: 109659, based in Karlsruhe,
> Managing director:  Prof. Dr. K. Schweizerhof, Dipl.-Math. U. Franz
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "sqlalchemy" 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/sqlalchemy?hl=en.
> 

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" 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/sqlalchemy?hl=en.

Reply via email to