Ticket #5188: generic_views_no_explicit_ordering.diff

File generic_views_no_explicit_ordering.diff, 790 bytes (added by James Bennett, 17 years ago)

Patch which removes the order_by calls

  • django/views/generic/date_based.py

     
    2828        raise Http404, "No %s available" % model._meta.verbose_name
    2929
    3030    if date_list and num_latest:
    31         latest = queryset.order_by('-'+date_field)[:num_latest]
     31        latest = queryset[:num_latest]
    3232    else:
    3333        latest = None
    3434
     
    7676    if not date_list and not allow_empty:
    7777        raise Http404
    7878    if make_object_list:
    79         object_list = queryset.filter(**lookup_kwargs).order_by(date_field)
     79        object_list = queryset.filter(**lookup_kwargs)
    8080    else:
    8181        object_list = []
    8282    if not template_name:
Back to Top