Robin Munn ha scritto:
> On 12/11/06, Jose Soares <[EMAIL PROTECTED]> wrote:
>   
>> Hi all,
>>
>> I need some help with in_ function....
>>
>> (Pdb) print codice
>> ['', '62714', '62601', '62602', '62612', '62614', '62603', '62610']
>> (Pdb) print type(codice)
>> <type 'list'>
>> (Pdb) print select([Attivita.c.cod_specie],
>> Attivita.c.codice.in_(tuple(codice)))
>> SELECT attivita.cod_specie
>> FROM attivita
>> WHERE attivita.codice = %(attivita_codice)s
>>     
>
> The in_() function expects to receive the list of values as multiple
> parameters. If it receives only one parameter, it assumes that that
> one parameter is a single value for the "IN" operation -- that is, you
> said something like "Attivita.c.codice.in_('62601')".
>
> So change that in_() call to "Attivita.c.codice.in_(*tuple(codice))"
> (or even just "Attivita.c.codice.in_(*codice)" for simplicity's sake)
> and you should get the expected results.
>
>   
thank you, Robin.

jo

--~--~---------~--~----~------------~-------~--~----~
 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