﻿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
26979	Using an admin.RelatedOnlyFieldListFilter in admin does not working if a type of a field is ForeignKey and value to_field is not pk (in my case it is UUID).	Seti	nobody	"
'''a field of a model ""User""'''


{{{
level = models.ForeignKey(
        'UserLevel',
        verbose_name='Level',
        related_name='users',
        default=UserLevel.CHOICES_LEVEL.regular,
        to_field='name',
        on_delete=models.PROTECT,
    )
}}}


an all code of a models.py is here http://dpaste.com/3SC68RK

'''a list_filter in a class AdminUser'''


{{{
list_filter = [
        ('level', admin.RelatedOnlyFieldListFilter),  # does not working since UUID not accetabled
        'is_superuser',
        ListFilterLastLogin,
        'date_joined',
    ]
}}}


an all code of a admin.py is here http://dpaste.com/0R0KPR9"	Bug	closed	contrib.admin	1.9	Normal	fixed	Admin, ForeignKey, models		Unreviewed	0	0	0	0	0	0
