#7840: 'get_list_or_404' does not know the slicing -----------------------------+---------------------------------------------- Reporter: spike | Owner: nobody Status: new | Milestone: Component: Core framework | Version: SVN Keywords: get_list_or_404 | Stage: Unreviewed Has_patch: 1 | -----------------------------+---------------------------------------------- To make a story short, see this code.
I have model, Document, it contains 30 objects. >>> get_list_or_404(Document) It returns entire objects of Document, but in this case, >>> get_list_or_404(Document)[:10] Not like a general usage of queryset filtering, get_list_or_404 does not handle the slicing, it just return the all the objects of model. To handle the slicing and return Http404 if there are not objects, wrote new sub-class, 'WrapperQueryset'. See the patched code. -- Ticket URL: <http://code.djangoproject.com/ticket/7840> Django Code <http://code.djangoproject.com/> The web framework for perfectionists with deadlines --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-updates?hl=en -~----------~----~----~----~------~----~------~--~---
