Dec-07-2019, 04:32 PM
from django.db import models from django.contrib.auth.models import User from django.utils import timezone from django.utils.text import slugify ##from django.contrib.auth.models import User ##from datetime import datetime ##from core.models import Product class Product(models.Model): pass myProduct=Product() myproduct.name=models.CharField(max_length=100) myProduct.description=models.TextField(max_length=500) myProduct.condition=models.CharField(max_length=100) myProduct.price=models.DecimalField(max_digits=10,decimal_places=5) myProduct.created=models.DateTimeField()
NameError: name 'myproduct' is not defined