Re: [Sqlalchemy-users] cascade rules - how do I on delete set null?

2006-07-29 Thread Michael Bayer
Brad Clements wrote: > given a one-to-many, and the one is deleted I want the many's to be set > null. > > How do I specify that in a relation cascade rule? > > cascade="null-orphan" ? for the many's to be set null, thats what it does by default, when you detach the child object from the parent,

Re: [Sqlalchemy-users] cascade rules - how do I on delete set null?

2006-07-28 Thread Jonathan Ellis
On 7/27/06, Brad Clements <[EMAIL PROTECTED]> wrote: given a one-to-many, and the one is deleted I want the many's to be set null.How do I specify that in a relation cascade rule?cascade="null-orphan"  ?and does save-update mean the same as "on update cascade" ? "on update|delete" is not supported

[Sqlalchemy-users] cascade rules - how do I on delete set null?

2006-07-28 Thread Brad Clements
given a one-to-many, and the one is deleted I want the many's to be set null. How do I specify that in a relation cascade rule? cascade="null-orphan" ? and does save-update mean the same as "on update cascade" ? -- I am having trouble relating these cascade rules to sql referential integrity

Re: [Sqlalchemy-users] cascade

2006-07-18 Thread Michael Bayer
On Jul 18, 2006, at 4:57 AM, Julien Cigar wrote: > Ok, I will try the association object, it looks better ! > > Another question, I'm using SQLAlchemy with mod_python. That means > that a Python interpreter is loaded in each apache process (in > prefork mode). In my application I use a global

Re: [Sqlalchemy-users] cascade

2006-07-18 Thread Julien Cigar
Ok, I will try the association object, it looks better ! Another question, I'm using SQLAlchemy with mod_python. That means that a Python interpreter is loaded in each apache process (in prefork mode). In my application I use a global session object per process (which is not threadsafe, but.. I

Re: [Sqlalchemy-users] cascade

2006-07-16 Thread Michael Bayer
SQLAlchemy cant coerce a separate "INSERT" and a "DELETE" operation into a single UPDATE statement. By creating a new InvasiveName() object and essentially giving it the same primary key as another InvasiveName() instance which is marked to be deleted, youre violating the "ORM expects pri

[Sqlalchemy-users] cascade

2006-07-16 Thread Julien Cigar
Hello list ! I have a little problem with the cascade property I think. Some rows are not deleted in the FK table. My tables definition looks like : create table invasives ( id serial not null, scientific_name varchar(200)not null,