This behavior is not the same as in BaseMonthArchiveView (which do qs =
self.get_dated_queryset(* * lookup_kwargs))
and prevents from using custom filtering in get_queryset.
Could you please remove the extra ordering="-%s" in the
BaseYearArchiveView and let the user handle the filtering?
Thanks a lot
--
Ticket URL: <https://code.djangoproject.com/ticket/21450>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/21450#comment:1>
Comment (by Thibault Serot <thibserot@…>):
Hello,
I actually see that there is also a default filtering + ordering in
BaseArchiveIndexView:
qs = self.get_dated_queryset(ordering='-%s' %
self.get_date_field())
date_list = self.get_date_list(qs, ordering='DESC')
Should be replaced by:
qs = self.get_dated_queryset()
date_list = self.get_date_list()
--
Ticket URL: <https://code.djangoproject.com/ticket/21450#comment:2>
Comment (by timo):
Is the current behavior documented? I see some
[https://docs.djangoproject.com/en/1.6/ref/class-based-views/generic-date-
based/ references to ordering in the docs]. Would this be a backwards
incompatible change for people relying on the current behavior? If we can
call it a bug, we may be able to change it (and sooner rather than later
would be best). Can you submit a patch with a test that demonstrates the
new functionality that we'd be adding?
--
Ticket URL: <https://code.djangoproject.com/ticket/21450#comment:3>
Comment (by aaugustin):
#18355 looks related.
--
Ticket URL: <https://code.djangoproject.com/ticket/21450#comment:4>
* has_patch: 1 => 0
* type: Bug => Cleanup/optimization
* stage: Unreviewed => Accepted
Comment:
Accepting on the basis of the problem, not sure about the proposed
solution at this point.
--
Ticket URL: <https://code.djangoproject.com/ticket/21450#comment:5>
Comment (by pjrharley):
Replying to [comment:4 aaugustin]:
> #18355 looks related.
I've added a PR there. I think it looks like it might close this ticket
too if accepted. By default the behaviour is the same but the user can now
easily use custom filtering (without overriding get_queryset either).
--
Ticket URL: <https://code.djangoproject.com/ticket/21450#comment:6>
Comment (by Tim Graham <timograham@…>):
In [changeset:"2724cdbff635a40819f206411de23e9b14867a58"]:
{{{
#!CommitTicketReference repository=""
revision="2724cdbff635a40819f206411de23e9b14867a58"
Fixed #18355 -- Added ordering options to list based generic views.
Added MultipleObjectMixin.ordering and get_ordering().
Refs #21450.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/21450#comment:7>
* status: new => closed
* resolution: => fixed
Comment:
Closing per above commit as I believe it solves it, but please reopen if
not.
--
Ticket URL: <https://code.djangoproject.com/ticket/21450#comment:8>