> Indeed I have to use the query/cursor mode. The query is a way more
> complex than that and I need some ordering based on calculated fields
> (which is not supported at the moment from the QuerySet api). I
> simplified the query simply to isolate the problem.
> some_id is indeed a foreign key to another table.
> 
> Any other suggestion?
> 
> Thanks again
> Francesco

id_list = [1, 2, 3]
query = """SELECT id
FROM my_table
WHERE my_table.some_id IN (%s)""" % ','.join(['%s'] * len(id_list))
cursor.execute(query, id_list)

Jonathan.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to