from django.conf.urls import patterns, url
-urlpatterns = patterns('samples.views',
- # View livrary list
- url(r'^$', 'library'),
- url(r'^not_run/$', 'library_not_run'),
- url(r'^(?P<lib_id>\w+)/$',
- 'library_to_flowcells'),
+from rest_framework import routers
- 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"^antibody/$", 'antibodies'),
+from .views import ExperimentTypeViewSet, LibraryViewSet, SpeciesViewSet
+
+urlpatterns = patterns(
+ 'samples.views',
+ # View library list
+ # url(r'^$', 'library'),
+ # url(r'^not_run/$', 'library_not_run'),
+ # url(r'^(?P<lib_id>\w+)/$',
+ # '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"^antibody/$", 'antibodies'),
)
+
+router = routers.DefaultRouter()
+router.register(r'species', SpeciesViewSet)
+router.register(r'libraries', LibraryViewSet)
+router.register(r'experiment_type', ExperimentTypeViewSet)
+urlpatterns += router.urls