Add CaseStudyDraft.created
This commit is contained in:
parent
39949562c1
commit
d80f933b7b
22
apps/map/migrations/0068_casestudydraft_created.py
Normal file
22
apps/map/migrations/0068_casestudydraft_created.py
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Generated by Django 1.11.6 on 2018-05-30 02:52
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
import django.utils.timezone
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('map', '0067_remove_old_images'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='casestudydraft',
|
||||||
|
name='created',
|
||||||
|
field=models.DateTimeField(auto_now_add=True, default=django.utils.timezone.now),
|
||||||
|
preserve_default=False,
|
||||||
|
),
|
||||||
|
]
|
@ -20,8 +20,13 @@ class CaseStudyDraft(models.Model):
|
|||||||
User, on_delete=models.CASCADE
|
User, on_delete=models.CASCADE
|
||||||
)
|
)
|
||||||
|
|
||||||
|
created = models.DateTimeField(auto_now_add=True)
|
||||||
|
|
||||||
data = models.TextField()
|
data = models.TextField()
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return "{0.author.username}, {0.created:%Y-%m-%d %H:%M}".format(self)
|
||||||
|
|
||||||
|
|
||||||
class SpatialRefSys(connection.ops.spatial_ref_sys()):
|
class SpatialRefSys(connection.ops.spatial_ref_sys()):
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user