Re: [sqlalchemy] SqlAclhemy 0.6.8 Delete orphan with objects that contain new objects (momentarily orphan)?

2011-12-11 Thread Hector Blanco
Oh, it wasn't exactly an error with the Synonyms itself. They are working fine for what I've been doing with them (just using them for getters/setters... nothing fancy) It was more that when I migrated the Synonyms I have in the 0.6.8 to hybrid_properties in 0.7.4, I was getting trouble (which I'm

[sqlalchemy] SqlAclhemy 0.6.8

2011-12-10 Thread Hector Blanco
Hello everyone! In my application, I have a class Product that can belong to a Category. (1 product, 1 category). The category knows which products belong to it thanks to a backref. A product can not exist if it doesn't belong to a category. If a category is deleted, all it's products are deleted

[sqlalchemy] SqlAclhemy 0.6.8 Delete orphan with objects that contain new objects (momentarily orphan)?

2011-12-10 Thread Hector Blanco
Sorry, I messed up the subject of the email -- Forwarded message -- From: Hector Blanco white.li...@gmail.com Date: 2011/12/10 Subject: SqlAclhemy 0.6.8 To: sqlalchemy@googlegroups.com Hello everyone! In my application, I have a class Product that can belong to a Category. (1

Re: [sqlalchemy] SqlAclhemy 0.6.8 Delete orphan with objects that contain new objects (momentarily orphan)?

2011-12-10 Thread Michael Bayer
On Dec 10, 2011, at 7:07 PM, Hector Blanco wrote: That data (is JSON) is sent to the Category handler. That handler does the following 1) Creates a new Category() instance, 2) Fill the non-relationship fields (_name in this case) 3) Adds the category to the session, so it gets an _id

Re: [sqlalchemy] SqlAclhemy 0.6.8 Delete orphan with objects that contain new objects (momentarily orphan)?

2011-12-10 Thread Hector Blanco
Thank you for your reply. I'm not exactly sure of what is blocking the insert. I would say SqlAlchemy, because my Foreign Keys are nullable (which raises the question of whether it's a good design or not... but that's a different story) I read in the documentation:

Re: [sqlalchemy] SqlAclhemy 0.6.8 Delete orphan with objects that contain new objects (momentarily orphan)?

2011-12-10 Thread Michael Bayer
if you have a relationship() with delete-orphan, SQLAlchemy will not let you save the child without the parent being attached. It is more or less a bug in that this particular check is unnecessary, and you should upgrade to 0.7. On Dec 11, 2011, at 12:00 AM, Hector Blanco wrote: Thank you

Re: [sqlalchemy] SqlAclhemy 0.6.8 Delete orphan with objects that contain new objects (momentarily orphan)?

2011-12-10 Thread Hector Blanco
I would like to. I've been testing 0.7.4, and it seems to work really fast, but my code is heavily dependent on Synonyms, which seem to be incompatible with certain new features (I'm getting errors when I use order_by, for instance) so, until I have time to migrate my code to Hibrids, I'm afraid I