Changeset 4470
- Timestamp:
- 02/09/07 21:39:56 (2 years ago)
- Files:
-
- django/trunk/django/db/models/query.py (modified) (1 diff)
- django/trunk/tests/modeltests/lookup/models.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/django/db/models/query.py
r4428 r4470 882 882 new_column = new_opts.pk.column 883 883 join_column = field.column 884 885 raise FieldFound 884 raise FieldFound 885 elif path: 886 # For regular fields, if there are still items on the path, 887 # an error has been made. We munge "name" so that the error 888 # properly identifies the cause of the problem. 889 name += LOOKUP_SEPARATOR + path[0] 890 else: 891 raise FieldFound 886 892 887 893 except FieldFound: # Match found, loop has been shortcut. django/trunk/tests/modeltests/lookup/models.py
r4394 r4470 207 207 [<Article: Article with \ backslash>, <Article: Article% with percent sign>, <Article: Article_ with underscore>, <Article: Article 5>, <Article: Article 6>, <Article: Article 4>, <Article: Article 2>, <Article: Article 3>, <Article: Article 7>, <Article: Article 1>] 208 208 209 # Programming errors are pointed out with nice error messages 210 >>> Article.objects.filter(pub_date_year='2005').count() 211 Traceback (most recent call last): 212 ... 213 TypeError: Cannot resolve keyword 'pub_date_year' into field 214 215 >>> Article.objects.filter(headline__starts='Article') 216 Traceback (most recent call last): 217 ... 218 TypeError: Cannot resolve keyword 'headline__starts' into field 219 209 220 """}
