Changeset 7561 for django/trunk/tests/regressiontests
- Timestamp:
- 05/29/08 07:17:03 (3 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/tests/regressiontests/one_to_one_regress/models.py
r5876 r7561 15 15 def __unicode__(self): 16 16 return u"%s the restaurant" % self.place.name 17 18 class Bar(models.Model): 19 place = models.OneToOneField(Place) 20 serves_cocktails = models.BooleanField() 21 22 def __unicode__(self): 23 return u"%s the bar" % self.place.name 17 24 18 25 class Favorites(models.Model): … … 35 42 >>> f.restaurants.all() 36 43 [<Restaurant: Demon Dogs the restaurant>] 44 45 # Regression test for #7173: Check that the name of the cache for the 46 # reverse object is correct. 47 >>> b = Bar(place=p1, serves_cocktails=False) 48 >>> b.save() 49 >>> p1.restaurant 50 <Restaurant: Demon Dogs the restaurant> 51 >>> p1.bar 52 <Bar: Demon Dogs the bar> 37 53 """}
