diff options
author | Yaroslav <contact@yaroslavps.com> | 2019-01-10 22:09:59 +0300 |
---|---|---|
committer | Yaroslav <contact@yaroslavps.com> | 2019-01-10 22:09:59 +0300 |
commit | 96fc77becc1d89ca555dd65d1a79ffa178cc3a5c (patch) | |
tree | 3632d620b6fd8b47d3d5430858371a457d7db8e1 /weblog/models.py | |
parent | ae6dda5c5c03bbca77ac9f7b6f4e62ef82703126 (diff) | |
download | w3blog-96fc77becc1d89ca555dd65d1a79ffa178cc3a5c.tar.gz w3blog-96fc77becc1d89ca555dd65d1a79ffa178cc3a5c.zip |
uncommented publish date, all migrations up to date, provided default value
Diffstat (limited to 'weblog/models.py')
-rwxr-xr-x | weblog/models.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/weblog/models.py b/weblog/models.py index dac8d1e..76db0e4 100755 --- a/weblog/models.py +++ b/weblog/models.py @@ -3,6 +3,7 @@ from django.db import models from django.forms import ModelForm, Textarea from django.shortcuts import reverse from django.utils.translation import pgettext_lazy, ugettext_lazy as _ +from django.utils import timezone class Category(models.Model): @@ -119,7 +120,7 @@ class PostComment(models.Model): 'Noun, as in blog post', 'Post'), on_delete=models.CASCADE) content = models.TextField(verbose_name=pgettext_lazy( 'Of post, comment, article, etc.', 'Content'), blank=False) - # publish_date = models.DateTimeField(verbose_name=_('Publish date')) + publish_date = models.DateTimeField(verbose_name=_('Publish date'), default=timezone.now()) class Meta: verbose_name = pgettext_lazy('Noun', 'Comment') |