ERROR: raise exceptions.ValidationError( django.core.exceptions.ValidationError: ['“” value has an invalid format. It must be in YYYY-MM-DD HH:MM[:ss[.uuuuuu]][TZ] format.']
models.py :
from django.db import models
from django.contrib.auth.models import User
from django.db.models.deletion import CASCADE
from django.utils.timezone import now
class Post(models.Model):
sno= models.AutoField(primary_key=True)
title= models.CharField(max_length=255)
author = models.CharField(max_length=13)
slug = models.CharField(max_length=130)
content= models.TextField()
timeStamp = models.DateTimeField(blank=True, null=True )
def __str__(self):
return self.title + ' by ' + self.author
class BlogComment(models.Model):
sno = models.AutoField(primary_key= True)
comment = models.TextField()
user = models.ForeignKey(User, on_delete=models.CASCADE)
parent = models.ForeignKey('self', on_delete=models.CASCADE, null=True)
timestamp = models.DateTimeField(null=True, blank=True)
Aucun commentaire:
Enregistrer un commentaire