Ticket #1839: m2o_recursive.diff
File m2o_recursive.diff, 837 bytes (added by , 19 years ago) |
---|
-
tests/modeltests/m2o_recursive/models.py
a b class Category(models.Model): 19 19 def __repr__(self): 20 20 return self.name 21 21 22 class Another(models.Model): 23 name = models.CharField(maxlength=20, core=True) 24 another = models.ForeignKey('self', null=True, related_name='child_set') 25 26 def __repr__(self): 27 return self.name 28 22 29 API_TESTS = """ 23 30 # Create a few Category objects. 24 31 >>> r = Category(id=None, name='Root category', parent=None) … … None 37 44 [] 38 45 >>> c.parent 39 46 Root category 47 48 >>> Category.AddManipulator().save(dict(id='3', name='Another root category', parent=None)) 49 Another root category 50 51 >>> anotherone = Another.AddManipulator().save(dict(id='3', name='Another root category', another=None)) 52 Another root category 40 53 """