summaryrefslogtreecommitdiff
path: root/ishtar_common/management/commands/update_towns.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@proxience.com>2014-12-30 16:58:28 +0100
committerÉtienne Loks <etienne.loks@proxience.com>2015-05-06 15:38:32 +0200
commitfa7d0e715228ccec391f6cc87b69abd50f442ef9 (patch)
treee9f76228e561db13b5d76df05cb590e6f8e85912 /ishtar_common/management/commands/update_towns.py
parent02d661f962fd8cd98cf21d04ec553dbdd6f72fb0 (diff)
downloadIshtar-fa7d0e715228ccec391f6cc87b69abd50f442ef9.tar.bz2
Ishtar-fa7d0e715228ccec391f6cc87b69abd50f442ef9.zip
Add new fields for towns - update default department and states for France
Diffstat (limited to 'ishtar_common/management/commands/update_towns.py')
-rw-r--r--ishtar_common/management/commands/update_towns.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/ishtar_common/management/commands/update_towns.py b/ishtar_common/management/commands/update_towns.py
new file mode 100644
index 000000000..fa201b677
--- /dev/null
+++ b/ishtar_common/management/commands/update_towns.py
@@ -0,0 +1,22 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+import csv
+import datetime, time
+
+from django.conf import settings
+from django.core.management.base import BaseCommand, CommandError
+
+from ishtar_common import tasks
+
+class Command(BaseCommand):
+ help = "Update department for french towns"
+
+ def handle(self, *args, **options):
+ self.stdout.write("* Loading towns\n")
+ self.stdout.flush()
+ created, updated = tasks.update_towns()
+ self.stdout.write("%d towns created, %s towns updated\n\n" % (created,
+ updated))
+ self.stdout.flush()
+