|
@@ -0,0 +1,26 @@
|
|
|
+# -*- coding: utf-8 -*-
|
|
|
+# Generated by Django 1.9.3 on 2016-03-03 13:26
|
|
|
+from __future__ import unicode_literals
|
|
|
+from email.utils import parsedate_to_datetime
|
|
|
+
|
|
|
+from django.db import migrations
|
|
|
+from django.utils.timezone import make_aware
|
|
|
+
|
|
|
+
|
|
|
+def migrate_date_field(apps, schema_editor):
|
|
|
+ Contrib = apps.get_model('contribmap', 'contrib')
|
|
|
+ for i in Contrib.objects.all():
|
|
|
+ if i.date:
|
|
|
+ i.date = make_aware(parsedate_to_datetime(i.old_date))
|
|
|
+ i.save()
|
|
|
+
|
|
|
+
|
|
|
+class Migration(migrations.Migration):
|
|
|
+
|
|
|
+ dependencies = [
|
|
|
+ ('contribmap', '0006_auto_20160303_1321'),
|
|
|
+ ]
|
|
|
+
|
|
|
+ operations = [
|
|
|
+ migrations.RunPython(migrate_date_field)
|
|
|
+ ]
|