text: from django.conf import settings
  from django.urls import reverse
  from django.db import models
  
  
  class List(models.Model):
      owner = models.ForeignKey(settings.AUTH_USER_MODEL, blank=True, null=True, on_delete=models.CASCADE)
  
      def get_absolute_url(self):
          return reverse('view_list', args=[self.id])
  
      @property
      def name(self):
          return self.item_set.first().text
  
  
  class Item(models.Model):
      text = models.TextField(default='', unique=False)
      list = models.ForeignKey(List, default=None, on_delete=models.CASCADE)
  
      def __str__(self):
          return self.text
  
      class Meta:
          ordering = ('id',)
          unique_together = ('list', 'text')
  