﻿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
3973	AttributeError for some models in the admin (newforms-admin branche)	Baptiste <baptiste.goupil@…>	nobody	"Here is the exception :
{{{
AttributeError at /admin/blog/article/
'NoneType' object has no attribute 'manager'
Request Method: 	GET
Request URL: 	http://127.0.0.1:8000/admin/blog/article/
Exception Type: 	AttributeError
Exception Value: 	'NoneType' object has no attribute 'manager'
Exception Location: 	/usr/lib/python2.4/site-packages/django/contrib/admin/filterspecs.py in __init__, line 161
}}}

I have located the error : it comes when I add some fields to 
{{{
list_filter = []
}}}
(in the admin.ModelAdmin class)[[BR]]
Some (DateTime, ForeignKey, Boolean) are okay, but if I add a CharField, a SlugField or even a TextField to the list_filter, I get the exception.

And here is the Traceback :
{{{
Traceback (most recent call last):
File ""/usr/lib/python2.4/site-packages/django/core/handlers/base.py"" in get_response
  77. response = callback(request, *callback_args, **callback_kwargs)
File ""/usr/lib/python2.4/site-packages/django/contrib/admin/sites.py"" in root
  123. return self.model_page(request, *url.split('/', 2))
File ""/usr/lib/python2.4/site-packages/django/contrib/admin/sites.py"" in model_page
  140. return admin_obj(request, rest_of_url)
File ""/usr/lib/python2.4/site-packages/django/contrib/admin/options.py"" in __call__
  136. return self.changelist_view(request)
File ""/usr/lib/python2.4/site-packages/django/contrib/admin/options.py"" in changelist_view
  486. self.date_hierarchy, self.search_fields, self.list_select_related, self.list_per_page, self)
File ""/usr/lib/python2.4/site-packages/django/contrib/admin/views/main.py"" in __init__
  263. self.filter_specs, self.has_filters = self.get_filters(request)
File ""/usr/lib/python2.4/site-packages/django/contrib/admin/views/main.py"" in get_filters
  271. spec = FilterSpec.create(f, request, self.params, self.model)
File ""/usr/lib/python2.4/site-packages/django/contrib/admin/filterspecs.py"" in create
  25. return factory(f, request, params, model)
File ""/usr/lib/python2.4/site-packages/django/contrib/admin/filterspecs.py"" in __init__
  161. self.lookup_choices = model._meta.admin.manager.distinct().order_by(f.name).values(f.name)

  AttributeError at /admin/blog/article/
  'NoneType' object has no attribute 'manager'
}}}"		closed	contrib.admin	newforms-admin		duplicate	attributeerror list_filter		Unreviewed	1	0	0	0	0	0
