diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-08-04 20:03:03 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-08-04 20:03:03 +0200 |
commit | 70f0ee9c5d7e5250ba5af7469158a8ff04dd4830 (patch) | |
tree | 378d8f0de8fe2da0069a29b4c176b8a3db964400 | |
parent | c497359bb3f9e47e1270ee7bca00a4e65989bcb8 (diff) | |
download | Ishtar-70f0ee9c5d7e5250ba5af7469158a8ff04dd4830.tar.bz2 Ishtar-70f0ee9c5d7e5250ba5af7469158a8ff04dd4830.zip |
Admin: fix point management for context record
-rw-r--r-- | archaeological_context_records/admin.py | 8 | ||||
-rw-r--r-- | archaeological_context_records/models.py | 2 |
2 files changed, 4 insertions, 6 deletions
diff --git a/archaeological_context_records/admin.py b/archaeological_context_records/admin.py index f20a9aebf..2733fa2ff 100644 --- a/archaeological_context_records/admin.py +++ b/archaeological_context_records/admin.py @@ -18,11 +18,9 @@ # See the file COPYING for details. from ajax_select import make_ajax_form -from ajax_select.fields import AutoCompleteSelectField, \ - AutoCompleteSelectMultipleField +from ajax_select.fields import AutoCompleteSelectField from django import forms -from django.conf import settings from django.contrib import admin from django.contrib.gis.forms import PointField, PolygonField, OSMWidget from django.utils.translation import ugettext_lazy as _ @@ -46,9 +44,9 @@ admin_site.register(models.Dating, DatingAdmin) class AdminContextRecordForm(forms.ModelForm): class Meta: - model = models.Operation + model = models.ContextRecord exclude = [] - point = PointField(label=_(u"Point"), required=False, + point_2d = PointField(label=_(u"Point"), required=False, widget=OSMWidget) polygon = PolygonField(label=_(u"Polygon"), required=False, widget=OSMWidget) diff --git a/archaeological_context_records/models.py b/archaeological_context_records/models.py index e3a344be8..f968c1d6e 100644 --- a/archaeological_context_records/models.py +++ b/archaeological_context_records/models.py @@ -298,7 +298,7 @@ class ContextRecord(BulkUpdatedItem, BaseHistorizedItem, ImageModel, OwnPerms, related_context_records = models.ManyToManyField( 'ContextRecord', through='RecordRelations', blank=True) point_2d = models.PointField(_(u"Point (2D)"), blank=True, null=True) - point = models.PointField(_(u"Point"), blank=True, null=True, dim=3) + point = models.PointField(_(u"Point (3D)"), blank=True, null=True, dim=3) polygon = models.PolygonField(_(u"Polygon"), blank=True, null=True) cached_label = models.TextField(_(u"Cached name"), null=True, blank=True) history = HistoricalRecords() |