[sqlalchemy] Re: strange problem with relation(..)

2009-07-29 Thread Jon Nelson
On Wed, Jul 29, 2009 at 9:16 PM, Michael Bayermike...@zzzcomputing.com wrote: On Jul 29, 2009, at 10:10 PM, BigJon wrote: On Jul 21, 2:53 pm, Michael Bayer mike...@zzzcomputing.com wrote: Jon Nelson wrote: The parent_id is NOT NULL and has no default. Doing something like this doesn't

[sqlalchemy] Re: strange problem with relation(..)

2009-07-29 Thread Michael Bayer
On Jul 29, 2009, at 10:48 PM, Jon Nelson wrote: sure just use default=my_callable(ctx). the ctx contains the bind parameters for the current row. you could also just use a MapperExtension. I am not sure how to apply a default when not defining the columns - I am sadly using database

[sqlalchemy] Re: strange problem with relation(..)

2009-07-29 Thread Jon Nelson
On Wed, Jul 29, 2009 at 9:54 PM, Michael Bayermike...@zzzcomputing.com wrote: On Jul 29, 2009, at 10:48 PM, Jon Nelson wrote: sure just use default=my_callable(ctx).  the ctx contains the bind parameters for the current row.   you could also just use a MapperExtension. I am not sure how

[sqlalchemy] Re: strange problem with relation(..)

2009-07-21 Thread Michael Bayer
Jon Nelson wrote: I encountered an odd issue today that I can't explain, and it seems like a bug. I've checked 0.5.4p2 and 0.5.5, and the behavior is the same. its a mistake I've seen before. Backrefs change the collection, so the iteration ends up granting only every other item. #

[sqlalchemy] Re: strange problem with relation(..)

2009-07-21 Thread Jon Nelson
On Tue, Jul 21, 2009 at 1:10 PM, Jon Nelsonjnel...@jamponi.net wrote: On Tue, Jul 21, 2009 at 10:47 AM, Michael Bayermike...@zzzcomputing.com wrote: Jon Nelson wrote: I encountered an odd issue today that I can't explain, and it seems like a bug. I've checked 0.5.4p2 and 0.5.5, and the

[sqlalchemy] Re: strange problem with relation(..)

2009-07-21 Thread Michael Bayer
Jon Nelson wrote: The parent_id is NOT NULL and has no default. Doing something like this doesn't seem to help, with or without the post_update=True (or False) configured on the mapper. the NOT NULL makes it impossible, unless you execute a sequence yourself and populate both columns before