﻿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
35020	DisallowedModelAdminLookup for foreign key to non-AutoField primary key	Joshua Goodwin	Sarah Boyce	"I have a model whose primary key is not an AutoField, and another model with a foreign key pointing at that:

{{{#!python
class Country(models.Model):
    id = models.CharField(max_length=2, primary_key=True)


class Place(models.Model):
    country = models.ForeignKey(Country, models.CASCADE)
}}}

And a ModelAdmin with this list_filter:

{{{#!python
@admin.register(models.Place)
class PlaceAdmin(admin.ModelAdmin):
    list_filter = [""country""]
}}}

Since 45ecd9acca9b36093e274f47b6877a5f79108d9e, filtering places by country in the admin site raises `django.contrib.admin.exceptions.DisallowedModelAdminLookup: Filtering by country__id__exact not allowed`"	Bug	closed	contrib.admin	5.0	Release blocker	fixed		Sarah Boyce	Ready for checkin	1	0	0	0	0	0
