From b7be3d63e36ee79db51dcabf0f210349e4d6f715 Mon Sep 17 00:00:00 2001 From: Malcolm Tredinnick Date: Fri, 22 Feb 2008 04:58:28 +0000 Subject: queryset-refactor: Added the ability to manually specify a child-parent link. git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@7142 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- tests/modeltests/model_inheritance/models.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tests') diff --git a/tests/modeltests/model_inheritance/models.py b/tests/modeltests/model_inheritance/models.py index 1187c5fe64..df0fb77ccb 100644 --- a/tests/modeltests/model_inheritance/models.py +++ b/tests/modeltests/model_inheritance/models.py @@ -67,6 +67,8 @@ class Supplier(Place): return u"%s the supplier" % self.name class ParkingLot(Place): + # An explicit link to the parent (we can control the attribute name). + parent = models.OneToOneField(Place, primary_key=True, parent_link=True) main_site = models.ForeignKey(Place, related_name='lot') def __unicode__(self): -- cgit v1.3