Ticket #12851: 12851_inheritance_regression_test.patch
File 12851_inheritance_regression_test.patch, 1.0 KB (added by , 15 years ago) |
---|
-
tests/regressiontests/select_related_regress/models.py
64 64 name = models.CharField(max_length=50) 65 65 state = models.ForeignKey(State, null=True) 66 66 status = models.ForeignKey(ClientStatus) 67 68 class SpecialClient(Client): 69 value = models.IntegerField() 67 70 68 71 # Some model inheritance exercises 69 72 class Parent(models.Model): … … 172 175 >>> burke = Client.objects.select_related('state').defer('state__name').get(name='Brian Burke') 173 176 >>> burke.state.name 174 177 u'Western Australia' 178 >>> _ = SpecialClient.objects.create(name='Markus McDonalds', state=wa, status=active, value=42) 179 >>> markus = SpecialClient.objects.select_related('state').defer('value', 'state__name').get(name='Markus McDonalds') 180 >>> markus.value 181 42 182 >>> markus.state.name 183 u'Western Australia' 175 184 176 185 """} 177