Excellent - thanks for all that work, I can't tell you how much I appreciate it.

On 10/13/06, Michael Bayer <[EMAIL PROTECTED]> wrote:
..snip..
> which is 6 pages !  I identified the cause of this as being a "double
> append" of a backreference operation, because you are both setting the
> parent "job" of "page" in the page constructor, as well as appending
> the "page" to the "job" in the job.create_page() method.  I commented
> out the "self.pages.append(p)" call in job.create_page to fix this.
> another way to address this would be to have the "pages" collection be
> a Set instead of a plain list.  (earlier versions of SA enforced
> uniqueness on collections, but this is no longer the case)

Ok, I need to maintain order (the relation has an "order_by") so that
means I need to use a list, right? Anyways, removing the
self.pages.append(p) works so I'm sticking with that, thanks :o)

> next I noticed the "somejob" name was not spelled correctly in the
> initial Job creation.  that is the cause of the first stack trace.

Doh.. <:-P

> fixing that, we had a deeper error in the UOW.  Because the "Page"
> class' primary key is derived from "jobno", when it was getting deleted
> it was also getting the "jobno" attribute set to "None".  the resulting
> "post_update" call for its "PageVersion" was then failing because it no
> longer knew the primary key of the parent Page object.  I made a
> modification to the "attribute synchronization" so that it will never
> set a primary key-holding attribute of an instance to None.  get rev
> 1981 of the trunk for that.

Excellent, thanks. I only discovered this error once the app was in
production. I might wait for the next release instead of upgrading to
the current trunk since job/page deletes are not that common yet
(well, only because I haven't written an interface for it :o).

> then it worked in SQLite.  this had to be tested in postgres, which is
> strict about foreign key enforcement.  to test in postgres, the
> composite foreign keys had to be specified properly, using
> ForeignKeyConstraint.  after that, the whole program completes.
> attached to this email.

Woohooo.. I can confirm that on my end as well.

Thank you again! I hope to repay the favour some day..

Arnar

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [EMAIL PROTECTED]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sqlalchemy
-~----------~----~----~----~------~----~------~--~---

Reply via email to