﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
8851	Add a default option to list_filter in the admin interface	Riskable <riskable@…>	Andrew Aikman	"There should be a way to set a default list_filter in the admin interface.  For example, if I had a model like this:

{{{
#!python
DECOM_CHOICES = (
	('N', 'No'),
	('Y', 'Yes'),
)

class Host(models.Model):
	hostname = models.CharField(max_length=36, unique=True)
	decommissioned = models.CharField(max_length=1, choices=DECOM_CHOICES, default='N')
	ip_address = models.IPAddressField()
	def __unicode__(self):
		return self.hostname

class HostAdmin(admin.ModelAdmin):
	fieldsets = [
		('Host Info', {'fields': ['hostname','decommissioned','ip_address']}),
	list_display = ('hostname', 'ip_address', 'decommissioned')
	list_filter = ('decommissioned')

admin.site.register(Host, HostAdmin)
}}}

I might want to make it so that by default only hosts that are not marked as decommissioned are displayed by default in the index.  It would be nice if I could just pass an option to list_filter to set the a filter that is enabled by default.  Perhaps something like this:
{{{
#!python
list_filter = ('decommissioned__exact=N') # Matches the URL if you click on ""No"" in the filter list
}}}
...or perhaps...
{{{
#!python
list_filter = ('decommissioned__default') # Have it choose the same default as specified in the model.
}}}
If there's already a simple way to do this I haven't found it and would appreciate an example.

Thanks!"	New feature	assigned	contrib.admin	dev	Normal		admin, list_filter, default	Carl Meyer Trevor Caira rlaager@… andy@… wizard@… kc9ddi remco@… net147 trbs@… a@… markus.magnuson@… andreas@… simon@… Narbonne Doug Harris	Accepted	0	0	0	0	0	0
