The "IN" comparison functionality only works if I pass the data in 
without a list.

Examples:
(broken)
 >>> sel=select([categories.c.id],categories.c.parent_id.in_ ( [1,34] ))
 >>> str(sel)
'SELECT categories.id \nFROM categories \nWHERE categories.parent_id = 
%(categories_parent_id)s'

(working)
 >>> sel=select([categories.c.id],categories.c.parent_id.in_(1,34))
 >>> str(sel)
'SELECT categories.id \nFROM categories \nWHERE categories.parent_id IN 
(%(categories_parent_id)s, %(categories_parent__1)s)

The docs:
http://www.sqlalchemy.org/docs/sqlconstruction.myt#sql_building
show the in_ function being able to operate on a list though.  The 
following block in sql.py catches the list in my example:
        elif len(other) == 1 and not hasattr(other[0], '_selectable'):
            return self.__eq__(other[0])

Perhaps the functionality should be changed.. or perhaps the docs could 
be changed to be in_(*keywords).  It probably doesn't matter either way, 
other than to be consistent.

Thanks
Dennis


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Sqlalchemy-users mailing list
Sqlalchemy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

Reply via email to