From f00cfdf8e27ae8b8614d51c18c0920b3f1bfa5ff Mon Sep 17 00:00:00 2001 From: Shane Frischkorn Date: Wed, 24 Jul 2013 21:45:19 +1000 Subject: [PATCH] adding reverse collection for children --- project_directory/common/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/project_directory/common/models.py b/project_directory/common/models.py index be9cc1a..018c8f7 100644 --- a/project_directory/common/models.py +++ b/project_directory/common/models.py @@ -14,7 +14,8 @@ class CommonInfo(models.Model): class Category(CommonInfo): parent = models.ForeignKey('self', blank=True, null=True, - on_delete=models.SET_NULL) + on_delete=models.SET_NULL, + related_name='children') class Sample(CommonInfo):