$NetBSD: patch-aa,v 1.1 2007/02/19 20:55:51 joerg Exp $

--- django/db/models/query.py.orig	2006-07-20 22:13:04.000000000 +0200
+++ django/db/models/query.py
@@ -827,7 +827,15 @@ def lookup_inner(path, lookup_type, valu
                 new_column = new_opts.pk.column
                 join_column = field.column
 
-            raise FieldFound
+                raise FieldFound
+            elif path:
+                # For regular fields, if there are still items on the path,
+                # an error has been made. We munge "name" so that the error
+                # properly identifies the cause of the problem.
+                name += LOOKUP_SEPARATOR + path[0]
+            else:
+                raise FieldFound
+
 
     except FieldFound: # Match found, loop has been shortcut.
         pass
