adding reverse collection for children
This commit is contained in:
parent
798ab9cbbe
commit
f00cfdf8e2
1 changed files with 2 additions and 1 deletions
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue