﻿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
1818	[patch] Slightly better error message for FieldDoesNotExist error	Christopher Lenz <cmlenz@…>	Adrian Holovaty	"Sometimes you get a `FieldDoesNotExist` error that does not provide enough information because it doesn't indicate which model class lacks a certain field. The following change would improve the error:

{{{
Index: django/db/models/options.py
===================================================================
--- django/db/models/options.py (revision 413)
+++ django/db/models/options.py (working copy)
@@ -94,7 +94,8 @@
         for f in to_search:
             if f.name == name:
                 return f
-        raise FieldDoesNotExist, ""name=%s"" % name
+        raise FieldDoesNotExist('%s has no field named ""%s""'
+                                % (self.module_name, name))
 
     def get_order_sql(self, table_prefix=''):
         ""Returns the full 'ORDER BY' clause for this object, according to self.ordering.""
}}}"	enhancement	closed	Core (Other)	dev	minor	fixed			Unreviewed	1	0	0	0	0	0
