text: from django.db import models
  from django.utils.encoding import python_2_unicode_compatible
  
  
  @python_2_unicode_compatible
  class TModel(models.Model):
      name = models.CharField(max_length=200)
  
      test = models.ManyToManyField(
          'self',
          blank=True,
          related_name='related_test_models'
      )
  
      for_inline = models.ForeignKey(
          'self',
          null=True,
          blank=True,
          related_name='inline_test_models'
      )
  
      def __str__(self):
          return self.name
  