use url function call for url definition instead of just a bare tuple
authorDiane Trout <diane@caltech.edu>
Tue, 17 Dec 2013 19:08:35 +0000 (11:08 -0800)
committerDiane Trout <diane@caltech.edu>
Tue, 17 Dec 2013 19:08:35 +0000 (11:08 -0800)
htsworkflow/frontend/eland_config/urls.py
htsworkflow/frontend/samples/urls.py
htsworkflow/frontend/urls.py

index a70940728d9a1e64cdc1dae8599444ca24b95d32..b4bc42b7ba4f1cbbc3443018676a8a3474f0a83f 100644 (file)
@@ -1,10 +1,10 @@
-from django.conf.urls import patterns
+from django.conf.urls import patterns, url
 
 urlpatterns = patterns('',
-    # Example:
-    
-    (r'^(?P<flowcell>\w+)/$', 'htsworkflow.frontend.eland_config.views.config'),
-    (r'^$', 'htsworkflow.frontend.eland_config.views.config'),
-    #(r'^$', 'htsworkflow.frontend.eland_config.views.index')
+    ## Example:
+
+    url(r'^(?P<flowcell>\w+)/$', 'htsworkflow.frontend.eland_config.views.config'),
+    url(r'^$', 'htsworkflow.frontend.eland_config.views.config'),
+    #url(r'^$', 'htsworkflow.frontend.eland_config.views.index')
 
 )
index bd8a8f6d41301c9ffc827a746984004e11a08fa1..570b1db72f2a83f97607c8bcaf1eb500cacac147 100644 (file)
@@ -1,8 +1,8 @@
-from django.conf.urls import patterns
+from django.conf.urls import patterns, url
 
 urlpatterns = patterns('',
-    (r"^library/(?P<library_id>\w+)/json", 'htsworkflow.frontend.samples.views.library_json'),
-    (r"^species/(?P<species_id>\w+)/json", 'htsworkflow.frontend.samples.views.species_json'),
-    (r"^species/(?P<species_id>\w+)", 'htsworkflow.frontend.samples.views.species'),
-    (r"^antibody/$", 'htsworkflow.frontend.samples.views.antibodies'),                   
+    url(r"^library/(?P<library_id>\w+)/json", 'htsworkflow.frontend.samples.views.library_json'),
+    url(r"^species/(?P<species_id>\w+)/json", 'htsworkflow.frontend.samples.views.species_json'),
+    url(r"^species/(?P<species_id>\w+)", 'htsworkflow.frontend.samples.views.species'),
+    url(r"^antibody/$", 'htsworkflow.frontend.samples.views.antibodies'),
 )
index 37817160aa523ca915eb348dc334fad8dcad2341..c21d9a0d12f6515c6c881d3d4fdc1c707c001130 100644 (file)
@@ -1,79 +1,64 @@
-from django.conf.urls import include, patterns
+from django.conf.urls import include, patterns, url
 from django.contrib import admin
 import django
 admin.autodiscover()
 
-# Databrowser:
-#from django.contrib import databrowse
-#from htsworkflow.frontend.samples.models import Library
-#databrowse.site.register(Library)
-#databrowse.site.register(FlowCell)
-
 from django.conf import settings
 
-
 urlpatterns = patterns('',
-    ('^accounts/login/$', 'django.contrib.auth.views.login'),
-    ('^accounts/logout/$', 'django.contrib.auth.views.logout'),
-    ('^accounts/logout_then_login/$', 'django.contrib.auth.views.logout_then_login'),
-    ('^accounts/password_change/$', 'django.contrib.auth.views.password_change'),
-    ('^accounts/password_change_done/$', 'django.contrib.auth.views.password_change_done'),
-    ('^accounts/profile/$', 'htsworkflow.frontend.samples.views.user_profile'),
+    url('^accounts/login/$', 'django.contrib.auth.views.login'),
+    url('^accounts/logout/$', 'django.contrib.auth.views.logout'),
+    url('^accounts/logout_then_login/$', 'django.contrib.auth.views.logout_then_login'),
+    url('^accounts/password_change/$', 'django.contrib.auth.views.password_change'),
+    url('^accounts/password_change_done/$', 'django.contrib.auth.views.password_change_done'),
+    #url('^accounts/profile/$', 'htsworkflow.frontend.samples.views.user_profile'),
     # Base:
-    (r'^eland_config/', include('htsworkflow.frontend.eland_config.urls')),
+    url(r'^eland_config/', include('htsworkflow.frontend.eland_config.urls')),
     ### MOVED Admin from here ###
-    #(r'^admin/(.*)', admin.site.root),
     # Experiments:
-    (r'^experiments/', include('htsworkflow.frontend.experiments.urls')),
-    # Flowcell:
-    (r'^lane/(?P<lane_pk>\w+)',
-     'htsworkflow.frontend.experiments.views.flowcell_lane_detail'),
-    (r'^flowcell/(?P<flowcell_id>\w+)/((?P<lane_number>\w+)/)?$',
-     'htsworkflow.frontend.experiments.views.flowcell_detail'),
-    # AnalysTrack:
-    #(r'^analysis/', include('htsworkflow.frontend.analysis.urls')),
-    # Inventory urls
-    (r'^inventory/', include('htsworkflow.frontend.inventory.urls')),
-    # Report Views:
-    (r'^reports/', include('htsworkflow.frontend.reports.urls')),
-    # Library browser
-    (r'^library/$', 'htsworkflow.frontend.samples.views.library'),
-    (r'^library/not_run/$',
-      'htsworkflow.frontend.samples.views.library_not_run'),
-    (r'^library/(?P<lib_id>\w+)/$',
-      'htsworkflow.frontend.samples.views.library_to_flowcells'),
-    (r'^lanes_for/$', 'htsworkflow.frontend.samples.views.lanes_for'),
-    (r'^lanes_for/(?P<username>\w+)', 'htsworkflow.frontend.samples.views.lanes_for'),
-    # library id to admin url
-    (r'^library_id_to_admin_url/(?P<lib_id>\w+)/$',
-     'htsworkflow.frontend.samples.views.library_id_to_admin_url'),
-    # sample / library information
-    (r'^samples/', include('htsworkflow.frontend.samples.urls')),
-    (r'^sequencer/(?P<sequencer_id>\w+)',
-       'htsworkflow.frontend.experiments.views.sequencer'),
-    # Raw result files
-    (r'^results/(?P<flowcell_id>\w+)/(?P<cnm>C[0-9]+-[0-9]+)/summary/',
-      'htsworkflow.frontend.samples.views.summaryhtm_fc_cnm'),
-    (r'^results/(?P<flowcell_id>\w+)/(?P<cnm>C[0-9]+-[0-9]+)/eland_result/(?P<lane>[1-8])',
-      'htsworkflow.frontend.samples.views.result_fc_cnm_eland_lane'),
-    (r'^results/(?P<fc_id>\w+)/(?P<cnm>C[1-9]-[0-9]+)/bedfile/(?P<lane>[1-8])/ucsc',
-      'htsworkflow.frontend.samples.views.bedfile_fc_cnm_eland_lane_ucsc'),
-    (r'^results/(?P<fc_id>\w+)/(?P<cnm>C[1-9]-[0-9]+)/bedfile/(?P<lane>[1-8])',
-      'htsworkflow.frontend.samples.views.bedfile_fc_cnm_eland_lane'),
-    (r'^bcmagic/', include('htsworkflow.frontend.bcmagic.urls')),
+    url(r'^experiments/', include('htsworkflow.frontend.experiments.urls')),
+    ### Flowcell:
+    url(r'^lane/(?P<lane_pk>\w+)',
+        'htsworkflow.frontend.experiments.views.flowcell_lane_detail'),
+    url(r'^flowcell/(?P<flowcell_id>\w+)/((?P<lane_number>\w+)/)?$',
+        'htsworkflow.frontend.experiments.views.flowcell_detail'),
+    ## AnalysTrack:
+    ##(r'^analysis/', include('htsworkflow.frontend.analysis.urls')),
+    ## Inventory urls
+    #url(r'^inventory/', include('htsworkflow.frontend.inventory.urls')),
+    ## Report Views:
+    ##url(r'^reports/', include('htsworkflow.frontend.reports.urls')),
+    ## Library browser
+    url(r'^library/$', 'htsworkflow.frontend.samples.views.library'),
+    url(r'^library/not_run/$',
+        'htsworkflow.frontend.samples.views.library_not_run'),
+    url(r'^library/(?P<lib_id>\w+)/$',
+        'htsworkflow.frontend.samples.views.library_to_flowcells'),
+    url(r'^lanes_for/$', 'htsworkflow.frontend.samples.views.lanes_for'),
+    url(r'^lanes_for/(?P<username>\w+)', 'htsworkflow.frontend.samples.views.lanes_for'),
+    ### library id to admin url
+    url(r'^library_id_to_admin_url/(?P<lib_id>\w+)/$',
+        'htsworkflow.frontend.samples.views.library_id_to_admin_url'),
+    ### sample / library information
+    url(r'^samples/', include('htsworkflow.frontend.samples.urls')),
+    url(r'^sequencer/(?P<sequencer_id>\w+)',
+        'htsworkflow.frontend.experiments.views.sequencer'),
+    ## Raw result files
+    #url(r'^results/(?P<flowcell_id>\w+)/(?P<cnm>C[0-9]+-[0-9]+)/summary/',
+      #'htsworkflow.frontend.samples.views.summaryhtm_fc_cnm'),
+    #url(r'^results/(?P<flowcell_id>\w+)/(?P<cnm>C[0-9]+-[0-9]+)/eland_result/(?P<lane>[1-8])',
+      #'htsworkflow.frontend.samples.views.result_fc_cnm_eland_lane'),
+    #url(r'^results/(?P<fc_id>\w+)/(?P<cnm>C[1-9]-[0-9]+)/bedfile/(?P<lane>[1-8])/ucsc',
+      #'htsworkflow.frontend.samples.views.bedfile_fc_cnm_eland_lane_ucsc'),
+    #url(r'^results/(?P<fc_id>\w+)/(?P<cnm>C[1-9]-[0-9]+)/bedfile/(?P<lane>[1-8])',
+      #'htsworkflow.frontend.samples.views.bedfile_fc_cnm_eland_lane'),
+    url(r'^bcmagic/', include('htsworkflow.frontend.bcmagic.urls')),
 
-    # databrowser
-    #(r'^databrowse/(.*)', databrowse.site.root)
+    url(r'^admin/', include(admin.site.urls)),
 )
 
-# Allow admin
-if hasattr(admin.site, 'urls'):
-  urlpatterns += patterns('', (r'^admin/', include(admin.site.urls)))
-else:
-  urlpatterns += patterns('', (r'^admin/(.*)', admin.site.root))
-
 if settings.DEBUG:
   urlpatterns += patterns('',
-      (r'^static/(?P<path>.*)$', 'django.views.static.serve',
+      url(r'^static/(?P<path>.*)$', 'django.views.static.serve',
         {'document_root': settings.MEDIA_ROOT}),
   )