Re: [sqlalchemy] Restricting a delete based on a many-to-many mapping (Using secondary)

2015-02-12 Thread Torsten Irländer
Am Donnerstag, 12. Februar 2015 18:57:43 UTC+1 schrieb Michael Bayer: Torsten Irländer torsten@googlemail.com javascript: wrote: Hi, I have a similar prolem as described in https://groups.google.com/forum/#!topic/sqlalchemy/OLeCERDZxyk I am using the secondary

Re: [sqlalchemy] Restricting a delete based on a many-to-many mapping (Using secondary)

2015-02-12 Thread Torsten Irländer
Am Donnerstag, 12. Februar 2015 21:02:21 UTC+1 schrieb Michael Bayer: Torsten Irländer torsten@googlemail.com javascript: wrote: Am Donnerstag, 12. Februar 2015 18:57:43 UTC+1 schrieb Michael Bayer: Torsten Irländer torsten@googlemail.com wrote: Hi

Re: [sqlalchemy] Restricting a delete based on a many-to-many mapping (Using secondary)

2015-02-12 Thread Torsten Irländer
Am Donnerstag, 12. Februar 2015 22:16:37 UTC+1 schrieb Michael Bayer: Torsten Irländer torsten@googlemail.com javascript: wrote: Nothing is wrong with the IntegrityException if this Exception is actually raised :) That is currently my problem: I except such an exception

[sqlalchemy] Restricting a delete based on a many-to-many mapping (Using secondary)

2015-02-12 Thread Torsten Irländer
Hi, I have a similar prolem as described in https://groups.google.com/forum/#!topic/sqlalchemy/OLeCERDZxyk I am using the secondary attribute to define the many-to-many relationship between User and Groups. Now i want prevent to delete a group if a user is still in the group. Setting the

[sqlalchemy] Re: Getting the mapped class from a property?

2012-03-24 Thread Torsten Irländer
import class_mapper parent_class = class_mapper(c2).get_property('parent').mapper.class_ 2012/3/23 Torsten Irländer torsten.irlaen...@googlemail.com Hi all, Lets say i have two tables t1 and t2 which have a 1:n relationship and are mapped to the classes c1 and c2. c2.parent is an FK

[sqlalchemy] Getting the mapped class from a property?

2012-03-23 Thread Torsten Irländer
Hi all, Lets say i have two tables t1 and t2 which have a 1:n relationship and are mapped to the classes c1 and c2. c2.parent is an FK to PK c1.id. This is quite forward and works like a charm. What i want is to get information about relations to other classes from within the mapped classes.