adding reverse collection for children
This commit is contained in:
@@ -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