﻿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
2145	list_filter not available if model contains OneToOneField	Daniel Roseman	nobody	"If a model is related to via a OneToOneField (even if it's not used in the admin list), the list_filter block doesn't appear on the admin list page.

The offending code appears to be in django.contrib.admin.views.main
{{{
571    def get_filters(self, request):
572        filter_specs = []
573        if self.lookup_opts.admin.list_filter and not self.opts.one_to_one_field:
574            filter_fields = [self.lookup_opts.get_field(field_name) \
575                              for field_name in self.lookup_opts.admin.list_filter]
}}}

Commenting out ""and not self.opts.one_to_one_field"" in line 573 reinstates the functionality and appears to have no ill effects. I don't know what it is supposed to be testing for, though, so don't know if it breaks something somewhere else. "	defect	closed	contrib.admin	dev	normal	fixed	OneToOneField ModelInheritance MultiTableInheritance editable parent_link	gary.wilson@…	Accepted	1	0	0	1	0	0
