Fixed date field on blog app
This commit is contained in:
parent
a5ae97fb46
commit
d5ed778d76
|
@ -0,0 +1,20 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import models, migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('blog', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='entry',
|
||||
name='date',
|
||||
field=models.DateTimeField(auto_now=True),
|
||||
preserve_default=True,
|
||||
),
|
||||
]
|
|
@ -4,7 +4,6 @@ from datetime import datetime
|
|||
from django.utils.timezone import utc
|
||||
from ckeditor.fields import RichTextField
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.utils.translation import activate
|
||||
|
||||
|
||||
#
|
||||
|
@ -12,7 +11,7 @@ from django.utils.translation import activate
|
|||
#
|
||||
class Entry(models.Model):
|
||||
title = models.CharField(max_length=128)
|
||||
date = models.DateTimeField(default=datetime.now(tz=utc))
|
||||
date = models.DateTimeField(auto_now=True)
|
||||
content = RichTextField()
|
||||
slug = models.SlugField(max_length=128)
|
||||
draft = models.BooleanField(default=True)
|
||||
|
@ -67,5 +66,3 @@ class Tag(models.Model):
|
|||
class Meta:
|
||||
app_label = 'blog'
|
||||
ordering = ['name']
|
||||
|
||||
|
||||
|
|
Reference in New Issue