diff options
Diffstat (limited to 'weblog')
-rw-r--r-- | weblog/migrations/0010_auto_20190110_1901.py | 31 | ||||
-rwxr-xr-x | weblog/models.py | 3 |
2 files changed, 33 insertions, 1 deletions
diff --git a/weblog/migrations/0010_auto_20190110_1901.py b/weblog/migrations/0010_auto_20190110_1901.py new file mode 100644 index 0000000..9016aff --- /dev/null +++ b/weblog/migrations/0010_auto_20190110_1901.py @@ -0,0 +1,31 @@ +# Generated by Django 2.0 on 2019-01-10 19:01 + +import datetime +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('weblog', '0009_merge_20190104_2123'), + ] + + operations = [ + migrations.AddField( + model_name='postcomment', + name='publish_date', + field=models.DateTimeField(default=datetime.datetime(2019, 1, 10, 19, 1, 18, 209024), verbose_name='Publish date'), + ), + migrations.AlterField( + model_name='category', + name='parent_category', + field=models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.SET_DEFAULT, to='weblog.Category', verbose_name='Parent category'), + ), + migrations.AlterField( + model_name='postcomment', + name='author', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL, verbose_name='Author'), + ), + ] 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') |