[sqlalchemy] Error in the behaviour of dynamic relation backreferences

2007-12-14 Thread David J. Mellor
I believe that I may have found an error in dynamic relation backrefences. When the dynamic query is executed, it appears to fetch all of the rows in the referenced table instead of only the ones linked to the object from which the dynamic relation was obtained. The following test script

[sqlalchemy] Re: SQL error for mapped select (new in version 0.4) on PostgreSQL

2007-12-14 Thread dykang
Hi, I was looking at this bug fix, and I couldn't figure out where part 2 of the problem was actually fixed. If you can ignore the absurdity of this example, it shows a situation where the second problem still appears to exist: from sqlalchemy import * from sqlalchemy.orm import * metadata =

[sqlalchemy] Re: SQL error for mapped select (new in version 0.4) on PostgreSQL

2007-12-14 Thread dykang
This example can't work in this sequence, or this query can't be run and mapped? If I wanted to execute this query: SELECT inner_query.test_id AS inner_query_test_id, inner_query.test_other_id AS inner_query_test_other_id, inner_query.test_active AS inner_query_test_active, inner_query.test2_id

[sqlalchemy] 'lazy=False' with polymorphic joined tables

2007-12-14 Thread Alexandre Conrad
Hi, I was wondering why lazy=False on a polymorphic joined table relation worked fine, until I pass an extra join() to filter with like(%foo%) statments from my search() method. I found an alternative where I just enable the relation's lazyness by providing lazyload(): #OK

[sqlalchemy] Re: Error in the behaviour of dynamic relation backreferences

2007-12-14 Thread David J. Mellor
On Friday 14 December 2007 7:41 am, Michael Bayer wrote: seems to work in SVN trunk, have you tried there ? Sorry - I forgot to mention that I ran this test against 0.4.1. I have not tried pulling from the trunk. --~--~-~--~~~---~--~~ You received this message

[sqlalchemy] Re: LIMIT in queries

2007-12-14 Thread Felix Schwarz
Chris M wrote: Or you could use .limit(1). I've always found that more clear than the Python indexing notation because I think of it slicing a list, not applying a limit to a query. Thank you very much for your help. I already found limit before my posting but it did not work, because I used

[sqlalchemy] Re: Error in the behaviour of dynamic relation backreferences

2007-12-14 Thread Chris M
Works for me on trunk. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to [EMAIL

[sqlalchemy] Re: LIMIT in queries

2007-12-14 Thread Mike Orr
On Dec 12, 2007 6:20 AM, King Simon-NFHD78 [EMAIL PROTECTED] wrote: Felix Schwarz wrote: Hi, after reading the docs [1] I thought that something like session.query(User).filter(User.c.id 3)[0] should work even if the filter clause does not return any rows. But - compliant with

[sqlalchemy] Re: SQL error for mapped select (new in version 0.4) on PostgreSQL

2007-12-14 Thread Michael Bayer
On Dec 14, 2007, at 1:34 PM, dykang wrote: This example can't work in this sequence, or this query can't be run and mapped? If I wanted to execute this query: SELECT inner_query.test_id AS inner_query_test_id, inner_query.test_other_id AS inner_query_test_other_id,

[sqlalchemy] Many-To-One...What I'm doing wrong?

2007-12-14 Thread Marcos
Hello, first at all, sorry about my english... I'm from Mendoza, Argentina, and I'm starting with this. Because I can't describe my problem, I will show the next: from sqlalchemy import * from sqlalchemy.orm import * class Producto(object): pass class Iva(object): pass metadata =

[sqlalchemy] Re: LIMIT in queries

2007-12-14 Thread Felix Schwarz
Mike Orr wrote: Are there that many of those, given that I don't think [N] is even documented? It is in the official documentation: http://www.sqlalchemy.org/docs/04/ormtutorial.html#datamapping_querying fs smime.p7s Description: S/MIME Cryptographic Signature

[sqlalchemy] Re: LIMIT in queries

2007-12-14 Thread Mike Orr
On Dec 14, 2007 1:31 PM, Felix Schwarz [EMAIL PROTECTED] wrote: Mike Orr wrote: Are there that many of those, given that I don't think [N] is even documented? It is in the official documentation: http://www.sqlalchemy.org/docs/04/ormtutorial.html#datamapping_querying OK. But the doc

[sqlalchemy] Re: Many-To-One...What I'm doing wrong?

2007-12-14 Thread sdobrev
your 'iva' table-column AND 'iva' attribute/relation/property have same name, Thats what the error says. either rename one of them (e.g. the column to become iva_id), or use that allow_column_override=True flag to the producto mapper. Marcos wrote: Hello, first at all, sorry about my

[sqlalchemy] Re: SQL error for mapped select (new in version 0.4) on PostgreSQL

2007-12-14 Thread Michael Bayer
On Dec 14, 2007, at 4:02 PM, dykang wrote: Sorry, I didn't clarify, I was speaking about with 0.3, not with 0.4. 0.3 has a very limited add_entity() method, with no ability to set it against an arbitrary alias, so its impossible in 0.3 for an ORM Query to load parallel instances where

[sqlalchemy] Re: LIMIT in queries

2007-12-14 Thread Michael Bayer
On Dec 14, 2007, at 5:22 PM, Mike Orr wrote: On Dec 14, 2007 1:31 PM, Felix Schwarz [EMAIL PROTECTED] wrote: Mike Orr wrote: Are there that many of those, given that I don't think [N] is even documented? It is in the official documentation:

[sqlalchemy] Re: concurent modification

2007-12-14 Thread imgrey
your s.close() is not being reached I've checked and found that every thread closes connection. And this traceback : QueuePool limit of size 5 overflow 10 reached, connection timed out most probably caused by long running thread which walking over list of filenames ~ 35 000 long. It renaming

[sqlalchemy] Re: concurent modification

2007-12-14 Thread Michael Bayer
On Dec 14, 2007, at 9:24 PM, imgrey wrote: as far as I understand 'SHARE ROW EXCLUSIVE' ( http://www.postgresql.org/docs/8.1/static/sql-lock.html ) lock is necessary here, but I was unable to find how to set it up in sqlalchemy. connection.execute(LOCK TABLE IN SHARE ROW EXCLUSIVE)