-
Notifications
You must be signed in to change notification settings - Fork 7
/
urls.py
195 lines (186 loc) · 6.38 KB
/
urls.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
# coding=utf-8
"""Urls for igrac apps."""
from django.conf.urls import url
from django.urls import include
from django.views.generic import TemplateView
from gwml2.api.authentication import TokenAuth
from gwml2.api.country import CountryAutocompleteAPI
from gwml2.api.mobile.minimized_well import (
WellListMinimizedAPI,
WellMeasurementListMinimizedAPI
)
from gwml2.api.mobile.well import WellCreateMinimizedAPI, WellEditMinimizedAPI
from gwml2.api.organisation import OrganisationAutocompleteAPI
from gwml2.api.task_progress import TaskProgress
from gwml2.api.upload_progress import get_progress_upload
from gwml2.api.upload_session import (
UploadSessionApiView, UploadSessionStopApiView, UploadSessionListApiView
)
from gwml2.api.user import UserAutocompleteAPI, UserUUIDAPI
from gwml2.api.well_deletion import WellDeletionAPI
from gwml2.api.well_measurement import WellLevelMeasurementData
from gwml2.api.well_relation import (
WellRelationDeleteView,
WellRelationListView,
WellMeasurementDataView
)
from gwml2.views.admin.delete_selected_confirmation_background import (
DeleteWellPostView, DeleteWellProgressView
)
from gwml2.views.download_request import (
DownloadRequestFormView,
DownloadRequestDownloadView,
DownloadRequestDownloadStatus
)
from gwml2.views.groundwater_form import (
WellView, WellFormView,
WellFormCreateView
)
from gwml2.views.organisation import OrganisationFormView, OrganisationListView
from gwml2.views.plugins.measurements_chart import (
MeasurementChart,
MeasurementChartIframe
)
from gwml2.views.upload_session import UploadSessionDetailView
from gwml2.views.well_uploader import WellUploadView
well_relation = [
url(r'^delete',
view=WellRelationDeleteView.as_view(),
name='well-relation-delete'),
]
well_detail_urls = [
url(r'^(?P<model>[\w\+%_& ]+)/(?P<model_id>\d+)/', include(well_relation)),
url(r'^(?P<model>[\w\+%_& ]+)/list', WellRelationListView.as_view(),
name='well-relation-list'),
url(r'^measurements/WellLevelMeasurement/chart-data',
WellLevelMeasurementData.as_view(),
name='well-level-measurement-chart-data'),
url(r'^measurements/(?P<model>[\w\+%_& ]+)/data',
WellMeasurementDataView.as_view(),
name='well-measurement-chart-data'),
url(r'^measurements/(?P<model>[\w\+%_& ]+)/chart/iframe',
MeasurementChartIframe.as_view(),
name='well-measurement-chart-iframe'),
url(r'^measurements/(?P<model>[\w\+%_& ]+)/chart',
MeasurementChart.as_view(),
name='well-measurement-chart'),
url(r'^edit',
view=WellFormView.as_view(),
name='well_form'),
url(r'^',
view=WellView.as_view(),
name='well_view'),
]
well_url = [
url(r'^download/(?P<uuid>[0-9a-f-]+)/status$',
view=DownloadRequestDownloadStatus.as_view(),
name='well_download_request_status'),
url(r'^download/(?P<uuid>[0-9a-f-]+)$',
view=DownloadRequestDownloadView.as_view(),
name='well_download_request_download'),
url(r'^download$',
view=DownloadRequestFormView.as_view(),
name='well_download_request'),
url(r'^create/',
view=WellFormCreateView.as_view(),
name='well_create'),
url(r'^(?P<id>\d+)/', include(well_detail_urls)),
]
organisation_url = [
url(r'^(?P<pk>\d+)/edit',
view=OrganisationFormView.as_view(),
name='organisation_form'),
url(r'^',
view=OrganisationListView.as_view(),
name='organisation_list')
]
user_url = [
url(r'^uuid/',
view=UserUUIDAPI.as_view(),
name='user_uuid')
]
api_minimized_url = [
url(r'^create',
view=WellCreateMinimizedAPI.as_view(),
name='well_create_api'),
url(r'^(?P<id>\d+)/edit',
view=WellEditMinimizedAPI.as_view(),
name='well_edit_api'),
url(r'^(?P<id>\d+)/(?P<measurement_type>[\w\+%_& ]+)',
view=WellMeasurementListMinimizedAPI.as_view(),
name='well_measurement_list_minimized_api'),
url(r'^',
view=WellListMinimizedAPI.as_view(),
name='well_list_minimized_api'),
]
api_url = [
url(r'^well/minimized/', include(api_minimized_url)),
# autocomplete
url(r'^organisation/autocomplete',
view=OrganisationAutocompleteAPI.as_view(),
name='organisation_autocomplete'),
url(r'^user/autocomplete',
view=UserAutocompleteAPI.as_view(),
name='user_autocomplete'),
url(r'^country/autocomplete',
view=CountryAutocompleteAPI.as_view(),
name='country_autocomplete'),
]
upload_session_url = [
url(r'^list',
view=UploadSessionListApiView.as_view(),
name='upload_session_list'),
url(r'^'
r'(?P<token>\b[0-9a-f]{8}\b-[0-9a-f]{4}-'
r'[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12}\b)/stop',
view=UploadSessionStopApiView.as_view(),
name='upload_session_stop'),
url(r'^'
r'(?P<token>\b[0-9a-f]{8}\b-[0-9a-f]{4}-'
r'[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12}\b)/',
view=UploadSessionApiView.as_view(),
name='upload_session_progress'),
url(r'^(?P<pk>\d+)/detail',
view=UploadSessionDetailView.as_view(),
name='upload_session_detail'),
]
urlpatterns = [
url(r'^token-auth',
view=TokenAuth.as_view(),
name='gwml2-token-aut'),
url(
r'^batch-upload/history',
TemplateView.as_view(template_name='upload_session/history.html'),
name='well_upload_history_view'
),
url(r'^batch-upload',
view=WellUploadView.as_view(),
name='well_upload_view'
),
url(r'^progress-upload',
view=get_progress_upload,
name='progress_upload'),
url(r'^task/(?P<task_id>.+)/progress/',
view=TaskProgress.as_view(),
name='task_progress'),
url(
r'^delete/well/progress/(?P<uuid>[0-9a-f-]+)/data',
view=WellDeletionAPI.as_view(),
name='delete-well-progress-data'
),
url(
r'^delete/well/progress/(?P<uuid>[0-9a-f-]+)',
view=DeleteWellProgressView.as_view(),
name='delete-well-progress-view'
),
url(
r'^delete/well/',
view=DeleteWellPostView.as_view(),
name='delete-well-confirmation-view'
),
url(r'^api/', include(api_url)),
url(r'^record/', include(well_url)),
url(r'^user/', include(user_url)),
url(r'^organisation/', include(organisation_url)),
url(r'^upload-session/', include(upload_session_url)),
]