summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Scheibenpflug <zorchenhimer@gmail.com>2015-06-20 22:08:38 (GMT)
committerNick Scheibenpflug <zorchenhimer@gmail.com>2015-06-20 22:08:38 (GMT)
commit96aea360c77deaff5048d29215a285e83ff61176 (patch)
tree730486455f1aaeb6b4bc236b98b156d4fc880381
parent32e0f117ae87ce98725c8f003f1e2aedb12ee87d (diff)
downloadmanga-reader-96aea360c77deaff5048d29215a285e83ff61176.zip
manga-reader-96aea360c77deaff5048d29215a285e83ff61176.tar.gz
Add first_created and last_modified timestamps to Manga model.
-rw-r--r--file_management/migrations/0006_auto_20150620_1806.py28
-rw-r--r--file_management/models.py4
2 files changed, 32 insertions, 0 deletions
diff --git a/file_management/migrations/0006_auto_20150620_1806.py b/file_management/migrations/0006_auto_20150620_1806.py
new file mode 100644
index 0000000..93fcb00
--- /dev/null
+++ b/file_management/migrations/0006_auto_20150620_1806.py
@@ -0,0 +1,28 @@
1# -*- coding: utf-8 -*-
2from __future__ import unicode_literals
3
4from django.db import models, migrations
5from django.utils.timezone import utc
6import datetime
7
8
9class Migration(migrations.Migration):
10
11 dependencies = [
12 ('file_management', '0005_uploadedorphan_oneshot'),
13 ]
14
15 operations = [
16 migrations.AddField(
17 model_name='manga',
18 name='first_created',
19 field=models.DateField(default=datetime.datetime(2015, 6, 20, 22, 6, 32, 236137, tzinfo=utc), auto_now_add=True),
20 preserve_default=False,
21 ),
22 migrations.AddField(
23 model_name='manga',
24 name='last_modified',
25 field=models.DateField(default=datetime.datetime(2015, 6, 20, 22, 6, 39, 701147, tzinfo=utc), auto_now=True),
26 preserve_default=False,
27 ),
28 ]
diff --git a/file_management/models.py b/file_management/models.py
index 68b9576..a4848ff 100644
--- a/file_management/models.py
+++ b/file_management/models.py
@@ -37,6 +37,10 @@ class Manga(models.Model):
37 # Single chapter oneshot? 37 # Single chapter oneshot?
38 oneshot = models.BooleanField(default=False) 38 oneshot = models.BooleanField(default=False)
39 39
40 # Timestamps
41 last_modified = models.DateField(auto_now=True)
42 first_created = models.DateField(auto_now_add=True)
43
40 def __str__(self): 44 def __str__(self):
41 return self.full_name 45 return self.full_name
42 46