Name all of the view that we need to reverse
authorDiane Trout <diane@ghic.org>
Wed, 1 Jun 2016 23:33:24 +0000 (16:33 -0700)
committerDiane Trout <diane@ghic.org>
Fri, 24 Jun 2016 22:55:49 +0000 (15:55 -0700)
Django 1.9 wants to remove reversing by package name,
as far as I can tell the simplest way to then reverse a
name to find the view is to name the url pattern.

The next few commits should take advantage of the names.

experiments/urls.py
htsworkflow/urls.py
inventory/urls.py
samples/urls.py

index 4037ca0c14a3fe6ccbbbb980eb51a8e7f008cb31..f0fbbf40a8437ea15537497edbad456fb8b65185 100644 (file)
@@ -15,7 +15,7 @@ urlpatterns = [
     #url(r'^(?P<run_folder>.+)/$', 'gaworkflow.frontend.experiments.views.detail'),
     url(r'^config/(?P<fc_id>.+)/json$', flowcell_json),
     url(r'^lanes_for/(?P<username>.+)/json$', lanes_for_json),
-    url(r'^file/(?P<key>.+)/?$', read_result_file),
+    url(r'^file/(?P<key>.+)/?$', read_result_file, name="read_result_file"),
     url(r'^started/(?P<pk>.+)/$', startedEmail),
     url(r'^finished/(?P<pk>.+)/$', finishedEmail),
 ]
index 02af9b3c606dc21a22caa8137be3c3a7064e0f5a..9df9a9506bcf7994bb4f31cd73bedc20c0795e4c 100644 (file)
@@ -17,17 +17,19 @@ urlpatterns = [
     url(r'^eland_config/', include('eland_config.urls')),
     # Experiments:
     url(r'^experiments/', include('experiments.urls')),
-    url(r'^lane/(?P<lane_pk>\w+)', flowcell_lane_detail),
-    url(r'^flowcell/(?P<flowcell_id>\w+)/((?P<lane_number>\w+)/)?$', flowcell_detail),
+    url(r'^lane/(?P<lane_pk>\w+)',
+        flowcell_lane_detail, name="flowcell_lane_detail"),
+    url(r'^flowcell/(?P<flowcell_id>\w+)/((?P<lane_number>\w+)/)?$',
+        flowcell_detail, name="flowcell_detail"),
     url(r'^inventory/', include('inventory.urls')),
     url(r'^library/', include('samples.urls')),
-    url(r'^lanes_for/$', lanes_for),
-    url(r'^lanes_for/(?P<username>[-_ \w]+)', lanes_for),
+    url(r'^lanes_for/(?P<username>[-_ \w]+)?',
+        lanes_for, name='lanes_for'),
     ### library id to admin url
     url(r'^library_id_to_admin_url/(?P<lib_id>\w+)/$', library_id_to_admin_url),
     ### sample / library information
     url(r'^samples/', include('samples.urls')),
-    url(r'^sequencer/(?P<sequencer_id>\w+)', sequencer),
+    url(r'^sequencer/(?P<sequencer_id>\w+)', sequencer, name="sequencer"),
 
     url(r'^admin/', include(admin.site.urls)),
 ]
index 4dcf1bd2bd52ea8f69d346affe1c8d8f42c78ebc..7f0df5c2afa606aa7fb94b3730c6b8eb3682be07 100644 (file)
@@ -17,13 +17,15 @@ urlpatterns = [
     # DATA
     url(r'^data/items/$', data_items),
     # REMOTE LINKING
-    url(r'^lts/link/(?P<flowcell>.+)/(?P<serial>.+)/$', link_flowcell_and_device),
+    url(r'^lts/link/(?P<flowcell>.+)/(?P<serial>.+)/$',
+        link_flowcell_and_device, name="link_flowcell_and_device"),
 
     # INDEX
-    url(r'^it/(?P<name>.+)/$', itemtype_index),
-    url(r'^(?P<uuid>[a-fA-F0-9]{32})/$', item_summary_by_uuid),
+    url(r'^it/(?P<name>.+)/$', itemtype_index, name="itemtype_index"),
+    url(r'^(?P<uuid>[a-fA-F0-9]{32})/$',
+        item_summary_by_uuid, name="item_summary_by_uuid"),
     url(r'^(?P<uuid>[a-fA-F0-9]{32})/print/$', item_print),
     url(r'^(?P<barcode_id>.+)/$', item_summary_by_barcode),
     url(r'^all_index/$', all_index),
-    url(r'^$', index)
+    url(r'^$', index, name='inventory_index')
 ]
index bc83238a72a5b8719b873f1316eb2ca71fcdde53..79e91f6bb2f083bf9b4471eff106a5ba97853ea8 100644 (file)
@@ -16,9 +16,9 @@ urlpatterns = [
     # View livrary list
     url(r'^$', library),
     url(r'^not_run/$', library_not_run),
-    url(r'^(?P<lib_id>\w+)/$', library_to_flowcells),
+    url(r'^(?P<lib_id>\w+)/$', library_to_flowcells, name='library_to_flowcells'),
     url(r"^library/(?P<library_id>\w+)/json$", library_json),
     url(r"^species/(?P<species_id>\w+)/json$", species_json),
-    url(r"^species/(?P<species_id>\w+)$", species),
+    url(r"^species/(?P<species_id>\w+)$", species, name='species'),
     url(r"^antibody/$", antibodies),
 ]