The query is rather complicated: http://rafb.net/p/qyx3vA47.html
The problem is at line 95 (the FIXME)

Thanks

Michael Bayer wrote:
> On Mar 27, 2007, at 10:00 AM, Julien Cigar wrote:
>
>   
>> Hello,
>>
>> I'm using SQLAlchemy 0.3.5, and it seems that the func() output is
>> broken with some functions.
>> I use the ANY function of PostgreSQL with something like :
>> func.any(q.c.habitats)==filter_habitat
>>
>> SQLAlchemy translates this in:
>> WHERE any(habitats) = %(any)s, which is incorrect.
>>     
>
>   
>> For example:
>>
>> the result should be :
>> iasdev=> select true as result where 'abc' = ANY(array['abc', 'def']);
>>  result
>> --------
>>  t
>>
>> where SQLAlchemy generates the query as :
>>
>> iasdev=> select true as result where ANY(array['abc', 'def']) = 'abc';
>> ERROR:  syntax error at or near "ANY" at character 29
>> LINE 1: select true as result where ANY(array['abc', 'def']) =  
>> 'abc'...
>>
>> Is this a bug ? (or maybe it's possible to keep the order...) ?
>>     
>
> can i have some complete code examples please ?  i dont understand  
> how your snippet would produce a full SELECT statement.  the phrase  
> youve shown me translates exactly as specified, assuming  
> "filter_habitat" is ia non ClauseElement::
>
>       func.any(q.c.habitats)==filter_habitat
>
>       should be:
>
>       any(habitats) = %(any)s
>
>
>
>
> >
>   


-- 
Julien Cigar
Belgian Biodiversity Platform
http://www.biodiversity.be
Université Libre de Bruxelles (ULB)
Campus de la Plaine CP 257
Bâtiment NO, Bureau 4 N4 115C (Niveau 4)
Boulevard du Triomphe, entrée ULB 2
B-1050 Bruxelles
office: [EMAIL PROTECTED]
home: [EMAIL PROTECTED]
biobel reference: http://biobel.biodiversity.be/biobel/person/show/471


--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to