[sqlalchemy] Re: Synchronization problem at backref of a one-to-many relation to the same class.

2009-10-09 Thread Christoph Zwerschke
Michael Bayer schrieb: I had the idea that since a1 appears to be in the collections of both u1 and u2, it would be arbitrary where a1 ended up after the flush completed. But that is likely wrong, in that the flush() is going to look at change events to determine what state changes to

[sqlalchemy] problem with like

2009-10-09 Thread Christian Démolis
Hi everybody, I m stuck with a query about telephone number : I want to find in my database all the contact who have a telephone number. The difficulty is that some number in the database can have space or . between numbers example : 06.06.50.44.11 or 45 87 12 45 65 This my query with like but

[sqlalchemy] Duck-typing style of relations

2009-10-09 Thread Yannick Gingras
Greetings Alchemists, this is more of a general data modeling question but maybe Alchemy has a neat trick to resolve this issue. It happens quite often that I want to use instances of a class as attributes of unrelated objects. One example is Addresses. Both Companies and Persons have

[sqlalchemy] Re: Synchronization problem at backref of a one-to-many relation to the same class.

2009-10-09 Thread Michael Bayer
Christoph Zwerschke wrote: Michael Bayer schrieb: I had the idea that since a1 appears to be in the collections of both u1 and u2, it would be arbitrary where a1 ended up after the flush completed. But that is likely wrong, in that the flush() is going to look at change events to

[sqlalchemy] Re: Duck-typing style of relations

2009-10-09 Thread Conor
Yannick Gingras wrote: Greetings Alchemists, this is more of a general data modeling question but maybe Alchemy has a neat trick to resolve this issue. It happens quite often that I want to use instances of a class as attributes of unrelated objects. One example is Addresses. Both

[sqlalchemy] Re: Duck-typing style of relations

2009-10-09 Thread Yannick Gingras
On October 9, 2009, Conor wrote: I think your best solution is similar to your AddressMap idea above, but just make it part of Address instead with check and unique constraints on your FK columns: [...] The check constraint above is a bit overkill for just 2 FK columns (you could just use

[sqlalchemy] Re: Duck-typing style of relations

2009-10-09 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Yannick Gingras Sent: 09 October 2009 14:43 To: sqlalchemy@googlegroups.com Subject: [sqlalchemy] Duck-typing style of relations Greetings Alchemists, this is more of a

[sqlalchemy] Re: postgresql CREATE SCHEMA statement does not create schema

2009-10-09 Thread Faheem Mitha
Confirmed by Alex Grönholm on #postgresql on freenode with pg 8.3 and sqla 0.5.6. If this is not a bug, i'd like to know what is going on. Typing the text in gq directly into psql (all on one line) produces the schema foo as expected.

[sqlalchemy] Re: postgresql CREATE SCHEMA statement does not create schema

2009-10-09 Thread Michael Bayer
did you commit your transaction or set autocommit=True in your text() statement ? that string you have will not trip off SQLA's autocommit feature. Faheem Mitha wrote: Confirmed by Alex Grönholm on #postgresql on freenode with pg 8.3 and sqla 0.5.6. If this is not a bug, i'd like to know

[sqlalchemy] Instance XXX is not persistent within this Session?

2009-10-09 Thread kris
I have been using the following recipe to keep a unique string table in our database: http://www.sqlalchemy.org/trac/wiki/UsageRecipes/UniqueObject After upgrading to 5.6, I started getting the following error Instance UniqueName XXX is not persistent within this Session 1. Does

[sqlalchemy] Re: problem with like

2009-10-09 Thread Andre Stechert
This is not really a sqlalchemy question, but the quick answer is that you need to convert both your indexed data and your queries to the same normal form. In your example, you appear to be correctly stripping spaces and periods in your query. If you haven't done that in the database, then you

[sqlalchemy] Re: postgresql CREATE SCHEMA statement does not create schema

2009-10-09 Thread Faheem Mitha
[This message has also been posted.] On Fri, 9 Oct 2009 13:28:58 -0400, Michael Bayer mike...@zzzcomputing.com wrote: did you commit your transaction or set autocommit=True in your text() statement ? that string you have will not trip off SQLA's autocommit feature. Hi, Thanks for the

[sqlalchemy] Re: postgresql CREATE SCHEMA statement does not create schema

2009-10-09 Thread Michael Bayer
On Oct 9, 2009, at 7:35 PM, Faheem Mitha wrote: Can you explain why removing the SET search_path TO public; string makes a commit happen? You also say that string you have will not trip off SQLA's autocommit feature. How does this autocommit feature work, and are there certain strings that