Ticket #13297: 13297_2.patch
File 13297_2.patch, 1.5 KB (added by , 14 years ago) |
---|
-
django/core/management/validation.py
259 259 # this format would be nice, but it's a little fiddly). 260 260 if '_' in field_name: 261 261 continue 262 try: 263 opts.get_field(field_name, many_to_many=False) 264 except models.FieldDoesNotExist: 265 e.add(opts, '"ordering" refers to "%s", a field that doesn\'t exist.' % field_name) 262 if field_name != 'pk': 263 try: 264 opts.get_field(field_name, many_to_many=False) 265 except models.FieldDoesNotExist: 266 e.add(opts, '"ordering" refers to "%s", a field that doesn\'t exist.' % field_name) 266 267 267 268 # Check unique_together. 268 269 for ut in opts.unique_together: -
tests/modeltests/ordering/models.py
23 23 24 24 def __unicode__(self): 25 25 return self.headline 26 26 27 28 class PkOrdering(models.Model): 29 30 class Meta: 31 ordering = ('pk',) 32 33 27 34 __test__ = {'API_TESTS':""" 28 35 # Create a couple of Articles. 29 36 >>> from datetime import datetime