Hi Michael,

thanks for your fast reply. How do you keep up with all this email?

On Tue, 2010-05-25 at 10:08 -0400, Michael Bayer wrote:


> I suppose you could try subclassing Session or perhaps seeing if the
> hooks provided with SessionExtension (I'm thinking the attach hook)
> give you enough to go on here.   Or, probably easier, just build
> yourself a wrapper class that looks like Session but proxies requests
> to it, after passing through your checks for current transaction
> active.

The attach hook would suffice to catch the session.add of new objects.
However, this is not my core interest, as it is highly unlikely that
somebody calls this by accident.

My goal is to catch property writes on mapped attributes. So I will
probably need an AttributeExtension, but I don't know how to access the
session state from there.

> It should go without saying that Clojure is from an entirely different
> philosophy than that of Python and SQLAlchemy (its author is hostile
> to the entire concept of object oriented design), so imitating
> particular behaviors of Clojure is not a core goal of the project.

:-) I don't know from what you infer that Rich is hostile to OO design.
Of course I don't ask from SQLAlchemy to imitate Clojure. It's just that
I find Clojures behaviour in this single context more intuitive.
I thought it would be a neat feature to support this kind of protection
in SQLAlchemy. Your mileage may vary.

Greetings, Torsten



-- 
DYNAmore Gesellschaft fuer Ingenieurdienstleistungen mbH
Torsten Landschoff

Office Dresden
Tel: +49-(0)351-4519587
Fax: +49-(0)351-4519561

mailto:torsten.landsch...@dynamore.de
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 sqlalch...@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