Good day! Tell me please. The site has a catalog of products, django-mptt is used for the section structure, is there any standard opportunity to build bread crumbs using the code of the section being browsed?
For example:
Women -> shoes -> shoes -> without a heel
Models look like this:
class Category(MPTTModel): name = models.CharField('Раздел', max_length=100) parent = TreeForeignKey('self', null=True, blank=True, related_name='children', db_index=True) sort = models.SmallIntegerField('Сортировка', default=100) class Product(models.Model): parent = models.ForeignKey(Category) name = models.CharField('Название', max_length=100) # ....