Commits

Flo Ledermann committed fc4d77c Draft

url patterns change: first view is specified, then location

Comments (0)

Files changed (1)

openresources/urls.py

 
 view_patterns = patterns('',
     url(r'^$', views.view, name='openresources_view'),
-    url(r'^view/(?P<name>[0-9A-Za-z-_]+)/json/$', views.view_json, name='geojson'),
-    url(r'^view/(?P<name>[0-9A-Za-z-_]+)/(?P<mode>.*)/$', views.view, name='openresources_view'),
-    url(r'^view/(?P<name>[0-9A-Za-z-_]+)/$', views.view, name='openresources_view'),
+    url(r'^in/(?P<area>[0-9A-Za-z-_]+)/$', views.view, name='openresources_view'),
+    url(r'^json/$', views.view_json, name='geojson'),
+    url(r'^(?P<mode>[0-9A-Za-z-_]+)/$', views.view, name='openresources_view'),
+    url(r'^in/(?P<area>[0-9A-Za-z-_]+)/(?P<mode>[0-9A-Za-z-_]+)/$', views.view, name='openresources_view'),
 )
 
 urlpatterns = patterns('',
 
     url(r'^json/all/$', views.all_json, name='geojson_all'),
 
-    url(r'^in/(?P<area>[0-9A-Za-z-_]+)/', include(view_patterns)),
     url(r'^', include(view_patterns)),
+    url(r'^view/(?P<name>[0-9A-Za-z-_]+)/', include(view_patterns)),
 
     # this cannot be reached, as we show the default view as an index page
     # however this is used for reversing the index page url in templates