Thanks! On Friday, 5 June 2015 08:53:48 UTC+1, kel...@ist-total.org wrote: > > On Fri Jun 5 08:32:52 2015 GMT+0100, Cherie Pun wrote: > > > > Thanks! Would this still give 404 errors when a certain object does not > > exist? > > Nope, but if you really need to ensure all ids exist in the database, > compare the length of your level_ids with levels.count() > Make sure there are no duplicates in the id list (e.g. use > set(level_ids)). > > If they differ raise Http404 manually. > > -- > Florian > > > On Tuesday, 2 June 2015 17:07:49 UTC+1, Simon Charette wrote: > > > > > > Hi Cherie, > > > > > > A `id__in` queryset lookup should issue a single query. > > > > > > levels = Level.objects.filter(id__in=level_ids)
-- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/1e5b6e7f-72bc-45f4-aac5-a3976945f990%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.