sqlstring -- a library to build a SELECT statement

grunar at gmail.com grunar at gmail.com
Thu Oct 20 19:24:27 EDT 2005


> person ** (
>   (person.type_id == 'customer')
>   & (person.id %= phone(phone.person_id)))
> )
>
Nevermind.  This doesn't work because all of the X= operators in
question are assignment operators, and therefore generate a Syntax
Error if in a nested expression. I think I've settled on just doing a
table.column.IN(blah) syntax.  This should be obvious to anyone reading
the code, and doesn't require mangling of the name (since it's
capitalized).  Then we'd have similar functions for other non intuitive
things, such as LIKE, EXISTS (on the table) and even a WHERE:

person.WHERE(
   (person.type_id == 'customer')
   & (person.id.IN(phone(phone.person_id)))
)




More information about the Python-list mailing list