adding reverse collection for children
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user