﻿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
16714	Can't list_filter across a relationship on a SmallIntegerField	Alex Ogier	nobody	"If you have a SmallIntegerField on a model that is related via a foreign key then you can't use that field as an option in list_filter. Doing so gives you the correct distinct options in the list page sidebar, but if you try to select any of them you receive a 302 redirect to /?e=1, as if you had used an unexpected query-string parameter.

Here's a small example to try yourself:

{{{
# models.py

from django.db import models

class Rel(models.Model):
    year = models.SmallIntegerField(default=2010)

class Src(models.Model):
    rel = models.ForeignKey(Rel)

# admin.py

from models import Rel, Src
from django.contrib import admin

class RelAdmin(admin.ModelAdmin):
    model = Rel
    list_filter = ('year',)
admin.site.register(Rel, RelAdmin)

class SrcAdmin(admin.ModelAdmin):
    model = Src
    list_filter = ('rel__year',)
admin.site.register(Src, SrcAdmin)
}}}

I'm running Django 1.3, MySQL 5.5, on Arch Linux."	Bug	new	contrib.admin	1.3	Normal				Unreviewed	0	0	0	0	0	0
