adding reverse collection for children
This commit is contained in:
1 parent
798ab9cbbe
commit
f00cfdf8e2
1 file changed
+2
-1
@@ -14,7 +14,8 @@ class CommonInfo(models.Model):
|
|||||||
|
|
||||||
class Category(CommonInfo):
|
class Category(CommonInfo):
|
||||||
parent = models.ForeignKey('self', blank=True, null=True,
|
parent = models.ForeignKey('self', blank=True, null=True,
|
||||||
on_delete=models.SET_NULL)
|
on_delete=models.SET_NULL,
|
||||||
|
related_name='children')
|
||||||
|
|
||||||
|
|
||||||
class Sample(CommonInfo):
|
class Sample(CommonInfo):
|
||||||
|
|||||||
Reference in new issue
Block a user