default=timezone.default is better than auto_now_add=True
This commit is contained in:
parent
f38b9801d0
commit
cc04fa5555
4 changed files with 9 additions and 5 deletions
|
|
@ -5,6 +5,7 @@ from django.conf import settings
|
|||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.core.exceptions import ValidationError
|
||||
from django.db import models
|
||||
from django.utils import timezone
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
|
||||
|
|
@ -68,7 +69,7 @@ class Changelog(models.Model):
|
|||
timestamp = models.DateTimeField(
|
||||
null=False,
|
||||
blank=False,
|
||||
auto_now_add=True,
|
||||
default=timezone.now,
|
||||
name='timestamp',
|
||||
verbose_name=_('timestamp'),
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue