summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ishtar_common/admin.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/ishtar_common/admin.py b/ishtar_common/admin.py
index 9ad8f304e..df2ea399f 100644
--- a/ishtar_common/admin.py
+++ b/ishtar_common/admin.py
@@ -421,6 +421,10 @@ class ImportGeoJsonForm(forms.Form):
year_name = forms.CharField(
label=_(u"Field name for year"), max_length=200, required=False
)
+ update = forms.BooleanField(
+ label=_(u"Update only geometry of existing towns"), required=False,
+ widget=forms.CheckboxInput
+ )
class ImportGEOJSONActionAdmin(object):
@@ -552,6 +556,7 @@ class ImportGEOJSONActionAdmin(object):
"name_name": request.POST.get('name_name'),
"surface_name": request.POST.get('surface_name', "") or "",
"year_name": request.POST.get('year_name', "") or "",
+ "update": request.POST.get('update', "") or "",
"insee_prefix": request.POST.get('numero_insee_prefix',
None) or '',
"surface_unit": int(request.POST.get('surface_unit'))
@@ -593,6 +598,9 @@ class ImportGEOJSONActionAdmin(object):
else:
modified = False
for k in values:
+ if not keys['update'] and k not in ["center",
+ "limit"]:
+ continue
if values[k] != getattr(t, k):
setattr(t, k, values[k])
modified = True