text: from django.db import models
  from django.utils.translation import ugettext_lazy as _
  from mptt.models import MPTTModel
  from mptt.fields import TreeForeignKey
  
  from myproject.apps.core.models import CreationModificationDateBase
  
  
  class Category(MPTTModel, CreationModificationDateBase):
      parent = TreeForeignKey(
          "self", on_delete=models.CASCADE, blank=True, null=True, related_name="children"
      )
      title = models.CharField(_("Title"), max_length=200)
  
      class Meta:
          ordering = ["tree_id", "lft"]
          verbose_name = _("Category")
          verbose_name_plural = _("Categories")
  
      class MPTTMeta:
          order_insertion_by = ["title"]
  
      def __str__(self):
          return self.title
  