What are models in Django?
Let’s create a Product table with name, price, and description attributes.
#models.py
from django.db import models#product modelclass Product(models.Model): name= models.CharField(max_length=30) price= models.models.IntegerField() description = models.TextField() def __str__(self): return f'{self.name}'Save For Revision
Save For Revision
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.