class Tag(models.Model):
parent = TreeForeignKey('self', null=True, blank=True, related_name='%(class)s_children')
products = models.ManyToManyField('Product', through="ProductTags", blank=True)
class Product(models.Model):
tags = models.ManyToManyField('Tag', through="ProductTags", blank=True)
tag_id in POST
currentTag = Tag.objects.get(id=tag_id)
childs = currentTag.get_children().filter(active=True)
应该选择具有当前标签的产品或当前标签的子标签