[sqlalchemy] AttributeEvents for mixin type classes

2011-10-04 Thread recurse
I'm having issues trying to add an event listener to a mixin class (which doesn't subclass Base) and wondering what kind of work-around there might be. It's probably easier to explain with an example ( http://paste.pocoo.org/show/487334/ ) Basically if I call event.listen(), and pass as a target

[sqlalchemy] Defining a relationship without a foreign key constraint?

2011-03-15 Thread recurse
I'm wondering if there is a way to define a relationship without creating an associated foreign key constraint in the database. It seems like relationship() requires me to define a foreign key, and that in turn automatically creates a foreign key constraint. I'm currently using the declarative