{{{
from django.db.models.utils import list_to_queryset
queryset = list_to_queryset(object_list)
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/28830>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* type: Uncategorized => New feature
* component: Core (Other) => Database layer (models, ORM)
* resolution: => wontfix
Comment:
I don't think this merits inclusion in Django. The code is simple enough
that it doesn't add much boilerplate for projects that want the behavior.
There are also several problems with the implementation that might be
footguns:
1) Ordering isn't preserved.
2) For large lists, the performance of
`model.objects.filter(pk__in=pk_list)` is usually poor.
--
Ticket URL: <https://code.djangoproject.com/ticket/28830#comment:1>