<filename>shoppingList/apps/shoppingItems/models.py
from django.db import models
from shoppingList.apps.account.models import User
from django.utils import timezone


class Item(models.Model):
    """
    Item model
    """
    name = models.CharField(max_length=20, blank=False)
    price = models.IntegerField(blank=False)
    owner = models.ForeignKey(User, on_delete=models.CASCADE)
    bought = models.BooleanField(default=False)

    class Meta:
        """
        allow unique item per user
        """
        unique_together = (('owner', 'name'))

    def __str__(self):
        """
        return string representtion of object
        """
        return self.name


class ShoppingList(models.Model):
    """
    Shopping List Model
    """

    class Meta:
        """
        allow unique name per user
        """
        unique_together = (('owner', 'name'))

    description = models.CharField(max_length=266, blank=True)
    name = models.CharField(max_length=20, blank=False)
    created_at = models.DateTimeField(editable=False)
    updated_at = models.DateTimeField()
    owner = models.ForeignKey(User, on_delete=models.CASCADE)
    items = models.ManyToManyField(Item)
    budget = models.IntegerField(default=0)

    def __str__(self):
        """
        return string representation of object
        """
        return self.name

    def save(self, *args, **kwargs):
        """
        update timestamps
        """
        if not self.pk:
            self.created_at = timezone.now()
        self.updated_at = timezone.now()
        return super(ShoppingList, self).save(*args, **kwargs)

<filename>shoppingList/apps/shoppingItems/models.py
from django.db import models
from shoppingList.apps.account.models import User
from django.utils import timezone


class Item(models.Model):
    """
    Item model
    """
    name = models.CharField(max_length=20, blank=False)
    price = models.IntegerField(blank=False)
    owner = models.ForeignKey(User, on_delete=models.CASCADE)
    bought = models.BooleanField(default=False)

    class Meta:
        """
        allow unique item per user
        """
        unique_together = (('owner', 'name'))

    def __str__(self):
        """
        return string representtion of object
        """
        return self.name


class ShoppingList(models.Model):
    """
    Shopping List Model
    """

    class Meta:
        """
        allow unique name per user
        """
        unique_together = (('owner', 'name'))

    description = models.CharField(max_length=266, blank=True)
    name = models.CharField(max_length=20, blank=False)
    created_at = models.DateTimeField(editable=False)
    updated_at = models.DateTimeField()
    owner = models.ForeignKey(User, on_delete=models.CASCADE)
    items = models.ManyToManyField(Item)
    budget = models.IntegerField(default=0)

    def __str__(self):
        """
        return string representation of object
        """
        return self.name

    def save(self, *args, **kwargs):
        """
        update timestamps
        """
        if not self.pk:
            self.created_at = timezone.now()
        self.updated_at = timezone.now()
        return super(ShoppingList, self).save(*args, **kwargs)

Item model allow unique item per user return string representtion of object Shopping List Model allow unique name per user return string representation of object update timestamps