On May 21, 2008, at 11:37 AM, Moshe C. wrote:

>
> Thanks.
> So I guess you cannot use the dictionary argument as is. It was very
> convenient.

It greatly complicated statement compilation since the cond_dict  
needed to be sent along to the compilation of table.select(), where  
extra logic kicked in involving more bind params to be generated,  
etc.  Removing that logic sped up statement compilation by around 20%  
and made the code much easier to read.


>
>
> On May 21, 6:16 pm, Michael Bayer <[EMAIL PROTECTED]> wrote:
>> On May 21, 2008, at 11:06 AM, Moshe C. wrote:
>>
>>
>>
>>> This is probably very simple, but I am searching the docs and not
>>> finding the answer :-(
>>
>>> In 0.3 I had a working statement of the form:
>>> engine.execute(table.select(), cond_dict)
>>> where cond_dict is a dictionary of column names mapped to values.
>>
>>> In 0.4.6 this does not work. What is produced in SQL is a select
>>> statement w/o the WHERE clause.
>>
>>> What is the correct way to migrate it, while still using the
>>> dictionary object?
>>
>> table.select().where(and_(*[table.c[k] == v for k, v in
>> cond_dict.iteritems()]))
> >


--~--~---------~--~----~------------~-------~--~----~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to