from django.db import models


class Categories(models.Model):
    id = models.AutoField(primary_key=True)
    name = models.CharField(max_length=25)


class Books(models.Model):
    id = models.AutoField(primary_key=True)
    category = models.ForeignKey(Categories, on_delete=models.CASCADE)
    title = models.CharField(max_length=255)
    thumbnail_url = models.TextField(max_length=255)
    price = models.CharField(max_length=8)
    stock = models.BooleanField()
    product_description = models.TextField(null=True)
    upc = models.CharField(max_length=25)

from django.db import models


class Categories(models.Model):
    id = models.AutoField(primary_key=True)
    name = models.CharField(max_length=25)


class Books(models.Model):
    id = models.AutoField(primary_key=True)
    category = models.ForeignKey(Categories, on_delete=models.CASCADE)
    title = models.CharField(max_length=255)
    thumbnail_url = models.TextField(max_length=255)
    price = models.CharField(max_length=8)
    stock = models.BooleanField()
    product_description = models.TextField(null=True)
    upc = models.CharField(max_length=25)
