I'm want to create nested categories, model work fine.
class Category(models.Model):
category_name = models.CharField(max_length=100)
children_ids = models.ManyToManyField(
"Category", blank=True, related_name="categories"
)
...etc
but, when i add inline for admin panel
class ChildrensInline(admin.TabularInline):
model = Category.children_ids.through
compiler shows me error: 'categories.Category_children_ids' has more than one ForeignKey to 'categories.Category'. You must specify a 'fk_name' attribute.
I also try fk_name='categories', and columns name inside Category_children_ids table, but it not work