Re: [sqlalchemy] Execute a function on orphan

2011-04-11 Thread Hector Blanco
That is what I was looking for! http://www.sqlalchemy.org/docs/orm/interfaces.html?highlight=attributeextension#sqlalchemy.orm.interfaces.AttributeExtension Thank you very much! 2011/4/10 Michael Trier mtr...@gmail.com: On Sat, Apr 9, 2011 at 10:32 PM, Hector Blanco white.li...@gmail.com

[sqlalchemy] Execute a function on orphan

2011-04-09 Thread Hector Blanco
Hello everyone! I have an application with Users and UserGroups... The users have certain permissions to do stuff in the application depending on the UserGroup they belong to. The relationship is as follows: -- class User(BaseClass.BaseClass, Database.Base):

Re: [sqlalchemy] Execute a function on orphan

2011-04-09 Thread Mike Conley
Not sure I understand the use case example. With these tables, doesn't the act of an administrator unassigning a user from its UserGroup set the group id column to NULL? If so, doesn't that effectively remove all the permissions because there is no longer a connection between the user and the

Re: [sqlalchemy] Execute a function on orphan

2011-04-09 Thread Hector Blanco
Unassigning a user from its userGroup, indeed, puts the UserGroup in that user to NULL. But it turns out that the entity that controls the permissions is a third thing. That thing takes some fields of the User class (id, name...) and generates an instance of a third object which is in charge of

Re: [sqlalchemy] Execute a function on orphan

2011-04-09 Thread Michael Trier
On Sat, Apr 9, 2011 at 10:32 PM, Hector Blanco white.li...@gmail.comwrote: Unassigning a user from its userGroup, indeed, puts the UserGroup in that user to NULL. But it turns out that the entity that controls the permissions is a third thing. That thing takes some fields of the User class