Ticket #2348: patch_with_test.diff
File patch_with_test.diff, 1.4 KB (added by , 18 years ago) |
---|
-
django/db/models/query.py
836 836 new_column = new_opts.pk.column 837 837 join_column = field.column 838 838 839 raise FieldFound 839 # If there are still items on path but this is not a related field, we're stuck. 840 # Add first element of path to current field name so the TypeError raised 841 # below properly identifies the cause of the problem. 842 if path and not field.rel: 843 name += LOOKUP_SEPARATOR + path[0] 844 else: 845 raise FieldFound 840 846 841 847 except FieldFound: # Match found, loop has been shortcut. 842 848 pass -
tests/modeltests/lookup/models.py
191 191 >>> Article.objects.filter(headline__contains='\\') 192 192 [<Article: Article with \ backslash>] 193 193 194 """} 194 # Test added for Ticket #2348 195 # Bad lookup parm should produce "Cannot resolve keyword", not "Unbound local error" 196 >>> Article.objects.filter(pub_date_year='2005').count() 197 Traceback (most recent call last): 198 ... 199 TypeError: Cannot resolve keyword 'pub_date_year' into field 200 201 """}