Opened 7 years ago
Closed 7 years ago
#28899 closed Uncategorized (needsinfo)
recursive relationship only works one way
Description ¶
class Catalog(models.Model): parent = models.ForeignKey('self',related_name='children', on_delete=models.CASCADE, null=True, blank=True)
Catalog.parent always return null, while Catalog.children.all() works fine.
Note:
See TracTickets
for help on using tickets.
I tried this and it worked for me: