I need to make a model for spices. Some spices may consist of others, or be basic. I need something like TreeForeignKey with multi-select option. I tried to use TreeManyToManyField, but I can't set null for base spices there. Here is my code:
class Goods(MPTTModel):
category = models.ForeignKey(Category,
related_name='goods',
on_delete=models.SET_NULL,
null=True)
name = models.CharField(max_length=150, db_index=True)
parent = TreeManyToManyField(
'self',
blank=True,)