ojuso-map/apps/map/urls.py
Anna Sidwell 677f6a85a9 Add coordinates autocomplete widget & data (#32)
Just tweaks based on what Carl had already written in dce53630 and b97d421a
2018-04-16 14:27:13 +10:00

23 lines
1.1 KiB
Python

from django.conf.urls import url
from django.urls import reverse_lazy
from django.views.generic import RedirectView
from djgeojson.views import GeoJSONLayerView
from .models import CaseStudy
from . import views
urlpatterns = [
url(r'^$', RedirectView.as_view(url=reverse_lazy('map')), name='index'),
url(r'^case-study/create/?$', views.Create.as_view(), name="create"),
url(r'^case-study/create/short/?$', views.ShortForm.as_view(), name='short-form'),
url(r'^case-study/create/long/?$', views.LongForm.as_view(), name='long-form'),
url(r'^case-study/create/success/?$', views.FormSuccess.as_view(), name='form-success'),
url(r'^case-study/draft/?$', views.Drafts.as_view(), name='drafts'),
url(r'^case-study/(?P<slug>[-\w]+)/?$', views.CaseStudyDetail.as_view(), name='detail'),
url(r'^map/?$', views.Map.as_view(), name='map'),
# API
url(r'^data.geojson$', GeoJSONLayerView.as_view(model=CaseStudy, geometry_field='location'), name='data'),
url(r'^srs-autocomplete/$', views.SpatialRefSysAutocomplete.as_view(), name='srs-autocomplete'),
]