On 2/8/07, Sergey Kirillov <[EMAIL PROTECTED]> wrote:
>     obj_list = klass._default_manager.in_bulk(oid_list)
>
>     return [obj_list[oid] for oid in oid_list]

Just a quick note for those playing along with custom ORDER BY stuff
(e.g., ordering by a non-column value generated by another part of the
query, like a COUNT(*)):

Remember to use in_bulk or Russell's method of selecting full rows and
instantiating objects from them if you're using order_by -- you can
pass to an "id__in" lookup and get a QuerySet, but it'll usually
clobber your ordering.

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