Reputation: 21
I am new to django. Can someone please solve my doubt? The variables used in django models are class variables or instance variables? if they are class variables, how each object can store an unique value like instance variable?
from django.db import models
class Product(models.Model):
name = models.CharField(max_length=64)
price = models.DecimalField(decimal_places=2, max_digits=100)
description = models.TextField()
summary = models.TextField(blank=True, null=True)
Upvotes: 1
Views: 151
Reputation: 166
It is instance variables.
Because its values are different in each object of the model and it is not shared between all objects.
Upvotes: 2