'NameError: name 'Bscs' is not defined

enter image description here[please help me, I'm new to making table for database and I don't know how to fix this][2]



Solution 1:[1]

This is short example for using ForeignKey

class Category(models.Model):
    name = models.CharField(max_length=30)

class Product(models.Model):
    product_name = models.CharField(max_length=100)
    category = models.Category(Category, on_delete=models.CASCADE)

Try to read about many-to-one relationship https://docs.djangoproject.com/en/4.0/topics/db/examples/many_to_one/

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 KamilBaranowskiCZ