* easy: => 0
Comment:
This would be very useful. Hoping for this in 1.4.
There is a ugly workaround on [http://stackoverflow.com/questions/851636
/default-filter-in-django-admin/3783930#3783930 StackOverflow], but this
does not show the default filter in the filterbar.
--
Ticket URL: <http://code.djangoproject.com/ticket/8851#comment:14>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* cc: net147 (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/8851#comment:16>
Comment (by charettes):
I think you can achieve this in 1.4+ by subclassing
`django.contrib.admin.ChoicesFieldListFilter`.
--
Ticket URL: <https://code.djangoproject.com/ticket/8851#comment:17>
* status: new => closed
* resolution: => fixed
Comment:
This feature has been already introduced in Django, unfortunately, I don't
know when. Basically, subclass `SimpleListFilter` and override two methods
`lookups` and `queryset`. You can read about it in
[https://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.list_filter
ModelAdmin.list_filter docs]
I'm closing this ticket as fixed, as described feature is in my opinion
what you were looking for. If you feel it's not what you need, please
reopen with detailed description what should be changed.
--
Ticket URL: <https://code.djangoproject.com/ticket/8851#comment:19>
* status: closed => new
* resolution: fixed =>
Comment:
I would argue that this is not fixed. I believe I have the same issue as
the OP - I want to choose which of the available filter options should be
selected by default. I don't want to customize the filtering behavior by
subclassing SimpleListFilter. The desired behavior is that when I go to
admin changelist url, it is *as if I had already chosen one of the
filtering options*. I don't want to change the behavior of the filtering
options. I just want one (the defined default) to be pre-selected.
--
Ticket URL: <https://code.djangoproject.com/ticket/8851#comment:20>
* cc: trbs@… (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/8851#comment:21>
* status: new => assigned
* owner: nobody => ckirby
--
Ticket URL: <https://code.djangoproject.com/ticket/8851#comment:22>
* owner: ckirby =>
* status: assigned => new
--
Ticket URL: <https://code.djangoproject.com/ticket/8851#comment:23>
* status: new => assigned
* owner: => hvdklauw
Comment:
Working on this during duth sprints
--
Ticket URL: <https://code.djangoproject.com/ticket/8851#comment:24>
* has_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/8851#comment:25>
* cc: a@… (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/8851#comment:26>
Comment (by avorio):
I'm willing to test this out once a patch has been committed.
Implemented simply, as originally described, this would be a very useful
feature indeed.
--
Ticket URL: <https://code.djangoproject.com/ticket/8851#comment:27>
Comment (by timgraham):
While testing after commit is certainly helpful, if you can give feedback
on and/or test the [https://github.com/django/django/pull/5579 pull
request] before it's committed, that's even more helpful.
--
Ticket URL: <https://code.djangoproject.com/ticket/8851#comment:28>
* needs_better_patch: 0 => 1
Comment:
Just did some testing as well, and the filters selected value does not
work correctly with the defaults. Working on a fix.
--
Ticket URL: <https://code.djangoproject.com/ticket/8851#comment:29>
* needs_better_patch: 1 => 0
Comment:
Totally forgot to update the ticket, it's all done and ready now.
--
Ticket URL: <https://code.djangoproject.com/ticket/8851#comment:30>
* cc: markus.magnuson@… (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/8851#comment:31>
Comment (by xblitz):
+1 and bump, will this be included in 1.10 ?
--
Ticket URL: <https://code.djangoproject.com/ticket/8851#comment:32>
Comment (by timgraham):
You can help by reviewing the patch using the PatchReviewChecklist and
marking the ticket "ready for checkin" when all looks good.
--
Ticket URL: <https://code.djangoproject.com/ticket/8851#comment:33>