<filename>wishlist/models.py<gh_stars>0
from django.conf import settings
from django.db import models
from django.db.models.signals import post_save
from django.dispatch import receiver
from rest_framework.authtoken.models import Token
from django.core.validators import MinValueValidator


@receiver(post_save, sender=settings.AUTH_USER_MODEL)
def create_auth_token(sender, instance=None, created=False, **kwargs):
    if created:
        Token.objects.create(user=instance)


class Wish(models.Model):
    owner = models.ForeignKey(
        settings.AUTH_USER_MODEL, 
        on_delete=models.CASCADE,
        related_name='wishes'
    )
    title = models.CharField(max_length=127)
    price = models.FloatField(default=0.0, validators=[MinValueValidator(0)])
    link = models.CharField(max_length=127, blank=True)
    description = models.TextField(blank=True)


<filename>wishlist/models.py<gh_stars>0
from django.conf import settings
from django.db import models
from django.db.models.signals import post_save
from django.dispatch import receiver
from rest_framework.authtoken.models import Token
from django.core.validators import MinValueValidator


@receiver(post_save, sender=settings.AUTH_USER_MODEL)
def create_auth_token(sender, instance=None, created=False, **kwargs):
    if created:
        Token.objects.create(user=instance)


class Wish(models.Model):
    owner = models.ForeignKey(
        settings.AUTH_USER_MODEL, 
        on_delete=models.CASCADE,
        related_name='wishes'
    )
    title = models.CharField(max_length=127)
    price = models.FloatField(default=0.0, validators=[MinValueValidator(0)])
    link = models.CharField(max_length=127, blank=True)
    description = models.TextField(blank=True)

