[sqlalchemy] Re: add if relationship is involved

2010-09-12 Thread Ernst
I found that it is essential to first point the parent to the child and only then set the back reference from in the child object to the parent. Otherwise the ORM goes into non-ending recursion. On Sep 12, 3:52 pm, Ernst er...@hisplace.net wrote: Hi, I do not understand the backref bit. With

Re: [sqlalchemy] Copying instances from old to new schema DB

2010-09-12 Thread chaouche yacine
The two instances don't have the same ID, the uniqueness is tested on two other columns. session.query(cls).filter(cls.the_unique_column==new_object.the_unique_column).first() Is there a way to get the tuple (usually a couple) of columns that are involved in a unique constraint ? if there is

[sqlalchemy] Oracle's XMLTyoe

2010-09-12 Thread millsks
I was curious if there were any way to pull a XMLType field into a python field when using declarative. I have been able to do it with cx_Oracle by executing a query using XMLType.getClobVal and would probably work with sqlalchemy's manual query system too, but would love it if I could use it as

Re: [sqlalchemy] passive_deletes/updates with sqlite

2010-09-12 Thread Michael Bayer
cant speak for Elixir, but your passive_deletes is on the wrong side in your declarative example. The correlations between classical and declarative relationship patterns are now individually contrasted at http://www.sqlalchemy.org/docs/orm/relationships.html#basic-relational-patterns . On

Re: [sqlalchemy] Re: add if relationship is involved

2010-09-12 Thread Michael Bayer
Its impossible for me to assist you further without the benefit of a complete example of what you're doing, including both tables, both mappers, an example of their manipulation. If you attach a test case make sure its self contained and does not rely on external libraries other than

Re: [sqlalchemy] Oracle's XMLTyoe

2010-09-12 Thread Michael Bayer
On Sep 12, 2010, at 6:23 AM, millsks wrote: I was curious if there were any way to pull a XMLType field into a python field when using declarative. I have been able to do it with cx_Oracle by executing a query using XMLType.getClobVal and would probably work with sqlalchemy's manual query

Re: [sqlalchemy] Oracle's XMLTyoe

2010-09-12 Thread Kevin Mills
Sorry about that. It was 4am this morning on my android so i wasnt thinking clearly yet. XMLType is an Oracle object type and library for storing and interacting with XML documents. getClobVal is a method of XMLType that returns an XML chunk of data as a CLOB instead of as an object. I have

Re: [sqlalchemy] Oracle's XMLTyoe

2010-09-12 Thread Michael Bayer
On Sep 12, 2010, at 12:28 PM, Kevin Mills wrote: Sorry about that. It was 4am this morning on my android so i wasnt thinking clearly yet. XMLType is an Oracle object type and library for storing and interacting with XML documents. getClobVal is a method of XMLType that returns an XML

Re: [sqlalchemy] Re: missing types in sqlalchemy.dialects.postgresql

2010-09-12 Thread Michael Bayer
On Sep 11, 2010, at 11:26 PM, Simon Wittber wrote: On Sep 12, 12:46 am, Michael Bayer mike...@zzzcomputing.com wrote: OK, sure. beyond that though do queries with the column and such do whats expected? Just tried this morning, and it works as expected, create / update statements

[sqlalchemy] add if relationship is involved

2010-09-12 Thread Ernst Arnold
Hi Michael I made a simplified but I think for the ORM equivalent example which I attach. In ExamplesTest.py I commented: # essential: ORM canot cope if this comes after s._mother = m It seems if that condition is not met then there is indefinite recursion. Whether that could/should be avoided by

Re: [sqlalchemy] passive_deletes/updates with sqlite

2010-09-12 Thread alex bodnaru
On 09/12/2010 04:27 PM, Michael Bayer wrote: cant speak for Elixir, but your passive_deletes is on the wrong side in your declarative example. The correlations between classical and declarative relationship patterns are now individually contrasted at

Re: [sqlalchemy] passive_deletes/updates with sqlite

2010-09-12 Thread alex bodnaru
On 09/12/2010 04:27 PM, Michael Bayer wrote: cant speak for Elixir, but your passive_deletes is on the wrong side in your declarative example. The correlations between classical and declarative relationship patterns are now individually contrasted at