On Jan 11, 2013, at 10:19 AM, YKdvd wrote:

> That sounds even nicer, and since I'm just starting out with no legacy code 
> I've been meaning to try dropping 0.8 in even before it is final.  It sounds 
> like I could just do something like event.listen(MyDeclarativeSubclass, 
> "load", myStamperFunc).
> 
>  I popped in 0.8b2 and tried something like this:
> 
> class SubBase(object):
> ...
> def MyLoadHandler(instance, context):
>    print "hit the load handler"
> MyBase = declarative_base(cls=SubBase)
> event.listen(MyBase, "load", MyLoadHandler)
> ...
> class MyDataClass(MyBase):
> ... do all the declarative stuff
> ...
> anInstance=session.query(MyDataClass).first()
> 
> 
> It doesn't complain about a non-existent event when I install the handler, 
> but the event handler doesn't seem to get called when the instance gets 
> loaded with the query.  I'll try and do a minimal little standalone test to 
> make sure it isn't something in my system messing things up, but in theory 
> this should work?


in theory.  It's new stuff and was very tricky to get it to work, so feel free 
to send a brief test along.



> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "sqlalchemy" group.
> To view this discussion on the web visit 
> https://groups.google.com/d/msg/sqlalchemy/-/rQwgslRRDGsJ.
> 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.

-- 
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