Skip to content

Commit 104632d

Browse files
committed
#25 add created_at and updated_at column to Sumari model
1 parent a5a126d commit 104632d

3 files changed

Lines changed: 44 additions & 0 deletions

File tree

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# -*- coding: utf-8 -*-
2+
# Generated by Django 1.10.4 on 2017-02-19 04:51
3+
from __future__ import unicode_literals
4+
5+
from django.db import migrations, models
6+
import django.utils.timezone
7+
8+
9+
class Migration(migrations.Migration):
10+
11+
dependencies = [
12+
('smap', '0003_auto_20170115_0336'),
13+
]
14+
15+
operations = [
16+
migrations.AddField(
17+
model_name='sumari',
18+
name='created_at',
19+
field=models.DateTimeField(auto_created=True, default=django.utils.timezone.now),
20+
preserve_default=False,
21+
),
22+
]
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# -*- coding: utf-8 -*-
2+
# Generated by Django 1.10.4 on 2017-02-19 04:52
3+
from __future__ import unicode_literals
4+
5+
from django.db import migrations, models
6+
7+
8+
class Migration(migrations.Migration):
9+
10+
dependencies = [
11+
('smap', '0004_sumari_created_at'),
12+
]
13+
14+
operations = [
15+
migrations.AddField(
16+
model_name='sumari',
17+
name='updated_at',
18+
field=models.DateTimeField(auto_now=True),
19+
),
20+
]

smap_app/smap/models.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ def __str__(self):
1818

1919

2020
class Sumari(models.Model):
21+
created_at = models.DateTimeField(auto_created=True)
22+
updated_at = models.DateTimeField(auto_now=True)
2123
tags = models.ManyToManyField(Tag)
2224
name = models.CharField(max_length=32)
2325
message = models.CharField(max_length=140)

0 commit comments

Comments
 (0)