Re: [Sqlalchemy-users] unexpected foreign key behaviour

2006-07-20 Thread Randall Smith
Michael Bayer wrote: > OK this test program is working correctly. > > the mapper setup you are trying is: > > mapper(T1, t1) > mapper(T2, t2, > properties={'t1':relation(T1, backref='t2s', private=True)} > ) > > and then the deletion looks like: > > UPDATE t2 SET t1_id=? WHERE t2.id = ? >

Re: [Sqlalchemy-users] unexpected foreign key behaviour

2006-07-20 Thread Michael Bayer
OK this test program is working correctly. the mapper setup you are trying is: mapper(T1, t1) mapper(T2, t2, properties={'t1':relation(T1, backref='t2s', private=True)} ) and then the deletion looks like: UPDATE t2 SET t1_id=? WHERE t2.id = ? [None, 2] UPDATE t2 SET t1_id=? WHERE t2.id = ?

Re: [Sqlalchemy-users] unexpected foreign key behaviour

2006-07-20 Thread Michael Bayer
oh, woops, i forgot to get to this one :) ill check it out now. On Jul 20, 2006, at 11:36 AM, Randall Smith wrote: > Randall Smith wrote: >> Michael Bayer wrote: >> >>> On Jul 18, 2006, at 5:54 PM, Randall Smith wrote: >>> >>> SQLError: (IntegrityError) null value in column "project_id" >

Re: [Sqlalchemy-users] unexpected foreign key behaviour

2006-07-20 Thread Randall Smith
Randall Smith wrote: > Michael Bayer wrote: > >> On Jul 18, 2006, at 5:54 PM, Randall Smith wrote: >> >> >>> SQLError: (IntegrityError) null value in column "project_id" violates >>> not-null constraint >>> 'UPDATE planreview.documents SET project_id=%(project_id)s WHERE >>> documents.id = %(docu

Re: [Sqlalchemy-users] unexpected foreign key behaviour

2006-07-19 Thread Randall Smith
Michael Bayer wrote: On Jul 18, 2006, at 5:54 PM, Randall Smith wrote: SQLError: (IntegrityError) null value in column "project_id" violates not-null constraint 'UPDATE planreview.documents SET project_id=%(project_id)s WHERE documents.id = %(documents_id)s' {'project_id': None, 'documents_

Re: [Sqlalchemy-users] unexpected foreign key behaviour

2006-07-18 Thread Randall Smith
Michael Bayer wrote: > On Jul 18, 2006, at 5:54 PM, Randall Smith wrote: > > >>SQLError: (IntegrityError) null value in column "project_id" violates >>not-null constraint >> 'UPDATE planreview.documents SET project_id=%(project_id)s WHERE >>documents.id = %(documents_id)s' {'project_id': None,

Re: [Sqlalchemy-users] unexpected foreign key behaviour

2006-07-18 Thread Michael Bayer
On Jul 18, 2006, at 5:54 PM, Randall Smith wrote: > > SQLError: (IntegrityError) null value in column "project_id" violates > not-null constraint > 'UPDATE planreview.documents SET project_id=%(project_id)s WHERE > documents.id = %(documents_id)s' {'project_id': None, > 'documents_id': 13} >

[Sqlalchemy-users] unexpected foreign key behaviour

2006-07-18 Thread Randall Smith
I'm getting unexpected behavior when deleting a record with a foreign key. I'm using the 0.2.5 rev 1712. When I delete a record that has a private=True attribute in the FK relationship, SA tries to update the record and set the FK to NULL instead of deleting the record. Applicable code. I tr