Ticket #13297: 13297_1.patch
File 13297_1.patch, 1003 bytes (added by , 14 years ago) |
---|
-
django/db/models/options.py
266 266 """ 267 267 Returns the requested field by name. Raises FieldDoesNotExist on error. 268 268 """ 269 if name == 'pk': 270 return self.pk 269 271 to_search = many_to_many and (self.fields + self.many_to_many) or self.fields 270 272 for f in to_search: 271 273 if f.name == name: -
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