On 5/12/07, checco <[EMAIL PROTECTED]> wrote:
> into a QuerySet? Or maybe there is a way to pass to the object_list
> view directly the list of objects as returned by the SQL statement
> (with cursor.fetchall())?

If you've got the list of ids, you can use an 'id__in' lookup to get a
QuerySet out of it, like so:

list_of_ids = [row[0] for row in cursor.fetchall()]
queryset = MyModel.objects.filter(id__in=list_of_ids)

Then you can pass that QuerySet to a generic view.

-- 
"Bureaucrat Conrad, you are technically correct -- the best kind of correct."

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