<filename>mysite/cats/models.py<gh_stars>0
from django.db import models
from django.core.validators import MinLengthValidator, MinValueValidator


class Breed(models.Model):
    name = models.CharField(
        max_length=200,
        validators=[MinLengthValidator(2, 'Breed must be greater than 1 character.')]
    )

    def __str__(self):
        """"String for representing the Model object."""
        return self.name

class Cat(models.Model):
    nickname = models.CharField(
        max_length=200,
        validators=[MinLengthValidator(2, 'Nickname must be greater than 1 character.')]
    )
    weight = models.FloatField(
        validators=[MinValueValidator(0.0, 'Weight must be greater than 0.')]
    )
    foods = models.CharField(max_length=300)
    breed = models.ForeignKey('Breed', on_delete=models.CASCADE, null=False)

    def __str__(self):
        """"String for representing the Model object."""
        return self.nickname
