|
1 | | -from django.conf.urls import url |
| 1 | +from django.urls import path |
2 | 2 |
|
3 | 3 | from . import views |
4 | 4 |
|
5 | 5 | urlpatterns = [ |
6 | | - url(r'^$', views.location_list, name='api_location_list'), |
7 | | - url(r'^(?P<pk>[0-9]+)/$', views.location_details, name='api_location_details'), |
| 6 | + path('', views.location_list, name='api_location_list'), |
| 7 | + path('<int:pk>', views.location_details, name='api_location_details'), |
8 | 8 | # geojson |
9 | | - url(r'^geojson/$', views.geojson_location_list, name='api_geojson_location_list'), |
10 | | - url( |
11 | | - r'^geojson/(?P<pk>[0-9]+)/$', |
| 9 | + path('geojson/', views.geojson_location_list, name='api_geojson_location_list'), |
| 10 | + path( |
| 11 | + 'geojson/<int:pk>/', |
12 | 12 | views.geojson_location_details, |
13 | 13 | name='api_geojson_location_details', |
14 | 14 | ), |
15 | | - url( |
16 | | - r'^geojson-nullable/(?P<pk>[0-9]+)/$', |
| 15 | + path( |
| 16 | + 'geojson-nullable/<int:pk>/', |
17 | 17 | views.geojson_nullable_details, |
18 | 18 | name='api_geojson_nullable_details', |
19 | 19 | ), |
20 | | - url( |
21 | | - r'^geojson_hidden/(?P<pk>[0-9]+)/$', |
| 20 | + path( |
| 21 | + 'geojson_hidden/<int:pk>/', |
22 | 22 | views.geojson_location_details_hidden, |
23 | 23 | name='api_geojson_location_details_hidden', |
24 | 24 | ), |
25 | | - url( |
26 | | - r'^geojson_none/(?P<pk>[0-9]+)/$', |
| 25 | + path( |
| 26 | + 'geojson_none/<int:pk>/', |
27 | 27 | views.geojson_location_details_none, |
28 | 28 | name='api_geojson_location_details_none', |
29 | 29 | ), |
30 | | - url( |
31 | | - r'^geojson/(?P<slug>[-\w]+)/$', |
| 30 | + path( |
| 31 | + 'geojson/<slug:slug>/', |
32 | 32 | views.geojson_location_slug_details, |
33 | 33 | name='api_geojson_location_slug_details', |
34 | 34 | ), |
35 | | - url( |
36 | | - r'^geojson-falseid/(?P<pk>[0-9]+)/$', |
| 35 | + path( |
| 36 | + 'geojson-falseid/<int:pk>/', |
37 | 37 | views.geojson_location_falseid_details, |
38 | 38 | name='api_geojson_location_falseid_details', |
39 | 39 | ), |
40 | | - url( |
41 | | - r'^geojson-noid/(?P<pk>[0-9]+)/$', |
| 40 | + path( |
| 41 | + 'geojson-noid/<int:pk>/', |
42 | 42 | views.geojson_location_noid_details, |
43 | 43 | name='api_geojson_location_noid_details', |
44 | 44 | ), |
45 | 45 | # file |
46 | | - url( |
47 | | - r'^geojson-file/(?P<pk>[0-9]+)/$', |
| 46 | + path( |
| 47 | + 'geojson-file/<int:pk>/', |
48 | 48 | views.geojson_located_file_details, |
49 | 49 | name='api_geojson_located_file_details', |
50 | 50 | ), |
51 | 51 | # geojson with bbox with its own geometry field |
52 | | - url( |
53 | | - r'^geojson-with-bbox/$', |
| 52 | + path( |
| 53 | + 'geojson-with-bbox/', |
54 | 54 | views.geojson_boxedlocation_list, |
55 | 55 | name='api_geojson_boxedlocation_list', |
56 | 56 | ), |
57 | | - url( |
58 | | - r'^geojson-with-bbox/(?P<pk>[0-9]+)/$', |
| 57 | + path( |
| 58 | + 'geojson-with-bbox/<int:pk>/', |
59 | 59 | views.geojson_boxedlocation_details, |
60 | 60 | name='api_geojson_boxedlocation_details', |
61 | 61 | ), |
62 | 62 | # geojson with bbox with autogenerated bbox |
63 | | - url( |
64 | | - r'^geojson-with-auto-bbox/$', |
| 63 | + path( |
| 64 | + 'geojson-with-auto-bbox/', |
65 | 65 | views.geojson_location_bbox_list, |
66 | 66 | name='api_geojson_location_bbox_list', |
67 | 67 | ), |
68 | 68 | # Filters |
69 | | - url( |
70 | | - r'^filters/contained_in_bbox$', |
| 69 | + path( |
| 70 | + 'filters/contained_in_bbox', |
71 | 71 | views.geojson_location_contained_in_bbox_list, |
72 | 72 | name='api_geojson_location_list_contained_in_bbox_filter', |
73 | 73 | ), |
74 | | - url( |
75 | | - r'^filters/overlaps_bbox$', |
| 74 | + path( |
| 75 | + 'filters/overlaps_bbox', |
76 | 76 | views.geojson_location_overlaps_bbox_list, |
77 | 77 | name='api_geojson_location_list_overlaps_bbox_filter', |
78 | 78 | ), |
79 | | - url( |
80 | | - r'^filters/contained_in_geometry$', |
| 79 | + path( |
| 80 | + 'filters/contained_in_geometry', |
81 | 81 | views.geojson_contained_in_geometry, |
82 | 82 | name='api_geojson_contained_in_geometry', |
83 | 83 | ), |
84 | | - url( |
85 | | - r'^filters/contained_in_tile$', |
| 84 | + path( |
| 85 | + 'filters/contained_in_tile', |
86 | 86 | views.geojson_location_contained_in_tile_list, |
87 | 87 | name='api_geojson_location_list_contained_in_tile_filter', |
88 | 88 | ), |
89 | | - url( |
90 | | - r'^filters/overlaps_tile$', |
| 89 | + path( |
| 90 | + 'filters/overlaps_tile', |
91 | 91 | views.geojson_location_overlaps_tile_list, |
92 | 92 | name='api_geojson_location_list_overlaps_tile_filter', |
93 | 93 | ), |
94 | | - url( |
95 | | - r'^filters/within_distance_of_point$', |
| 94 | + path( |
| 95 | + 'filters/within_distance_of_point', |
96 | 96 | views.geojson_location_within_distance_of_point_list, |
97 | 97 | name='api_geojson_location_list_within_distance_of_point_filter', |
98 | 98 | ), |
99 | | - url( |
100 | | - r'^filters/within_degrees_of_point$', |
| 99 | + path( |
| 100 | + 'filters/within_degrees_of_point', |
101 | 101 | views.geojson_location_within_degrees_of_point_list, |
102 | 102 | name='api_geojson_location_list_within_degrees_of_point_filter', |
103 | 103 | ), |
104 | | - url( |
105 | | - r'^filters/order_distance_to_point$', |
| 104 | + path( |
| 105 | + 'filters/order_distance_to_point', |
106 | 106 | views.geojson_location_order_distance_to_point_list, |
107 | 107 | name='api_geojson_location_order_distance_to_point_list_filter', |
108 | 108 | ), |
|
0 commit comments