change mapitems API to geometry API.
This commit is contained in:
parent
a3d0f6dac3
commit
769343f78a
9 changed files with 88 additions and 158 deletions
|
@ -23,7 +23,7 @@ class FeatureFormMixin(ModelForm):
|
|||
if not creating and not settings.DIRECT_EDITING:
|
||||
self.fields['name'].disabled = True
|
||||
|
||||
if creating and self._meta.model in (Door, ):
|
||||
if creating and self._meta.model in (Door, Obstacle, ):
|
||||
self.fields['name'].initial = uuid.uuid4()
|
||||
|
||||
# restrict package choices and field_name
|
||||
|
|
|
@ -7,14 +7,14 @@ from django.shortcuts import get_object_or_404, render
|
|||
from django.utils import translation
|
||||
|
||||
from c3nav.editor.hosters import get_hoster_for_package, hosters
|
||||
from c3nav.mapdata.models import MAPITEM_TYPES
|
||||
from c3nav.mapdata.models import GEOMETRY_MAPITEM_TYPES
|
||||
from c3nav.mapdata.models.package import Package
|
||||
from c3nav.mapdata.packageio.write import json_encode
|
||||
from c3nav.mapdata.permissions import can_access_package
|
||||
|
||||
|
||||
def edit_feature(request, feature_type, name=None):
|
||||
model = MAPITEM_TYPES.get(feature_type)
|
||||
model = GEOMETRY_MAPITEM_TYPES.get(feature_type)
|
||||
if model is None:
|
||||
raise Http404()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue