﻿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
25606	"Add support for ""__"" lookup in RelatedOnlyFieldListFilter"	Ivo van Doesburg	nobody	"Given this ModelAdmin:

{{{
class BookAdminRelatedOnlyFilter(admin.ModelAdmin):
    list_filter = (
        'edition__publisher',
        ('edition__publisher', RelatedOnlyFieldListFilter),
    )
}}}


The first filter works fine, but the second results in a FieldError: Cannot resolve keyword 'publisher' into field. 

The reason this happens is because RelatedOnlyFieldListFilter uses field.name instead of the field_path, where field is the result of get_fields_from_path, which returns the 'publisher' field

This patch fixes this behaviour: https://github.com/django/django/compare/master...quarkness:related-only-filter-field-path
It also improves performance by using .distinct() on the database to get unique values instead of set()
"	Bug	closed	contrib.admin	1.8	Normal	fixed			Ready for checkin	1	0	0	0	0	0
