Skip to content

Commit

Permalink
fix news post fields. closes #54
Browse files Browse the repository at this point in the history
  • Loading branch information
mikemaddem committed May 7, 2020
1 parent 51988d9 commit 9639007
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 1 deletion.
19 changes: 19 additions & 0 deletions news/migrations/0003_auto_20200507_1737.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Generated by Django 2.2.12 on 2020-05-07 17:37

from django.db import migrations, models
import django.utils.timezone


class Migration(migrations.Migration):

dependencies = [
('news', '0002_auto_20190713_1335'),
]

operations = [
migrations.AlterField(
model_name='post',
name='publish',
field=models.DateTimeField(default=django.utils.timezone.now, null=True),
),
]
19 changes: 19 additions & 0 deletions news/migrations/0004_auto_20200507_1741.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Generated by Django 2.2.12 on 2020-05-07 17:41

from django.db import migrations, models
import django.utils.timezone


class Migration(migrations.Migration):

dependencies = [
('news', '0003_auto_20200507_1737'),
]

operations = [
migrations.AlterField(
model_name='post',
name='publish',
field=models.DateTimeField(blank=True, default=django.utils.timezone.now, null=True),
),
]
2 changes: 1 addition & 1 deletion news/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Post(models.Model):
slug = models.SlugField(max_length=250, unique_for_date='publish')
author = models.ForeignKey(User, related_name='blog_posts', on_delete=models.SET_NULL, null=True, blank=True)
body = models.TextField()
publish = models.DateTimeField(default=timezone.now, blank=True)
publish = models.DateTimeField(default=timezone.now, null=True, blank=True)
created = models.DateTimeField(auto_now_add=True)
updated = models.DateTimeField(auto_now=True)
status = models.CharField(max_length=12, choices=STATUS_CHOICES, default='draft')
Expand Down

0 comments on commit 9639007

Please sign in to comment.