Unverified Commit 8b4a1f34 authored by David Haynes's avatar David Haynes
Browse files

refactor: Clean up urls.py to prepare for 1.10

- urlpatterns becomes a list
- remove unused imports
- comments
parent be644c24
from django.conf.urls import patterns, include, url
from website.views import *
# Django Imports
from django.conf.urls import include, url
# App Imports
from .views import CategoryViewSet, FacilityViewSet, ScheduleViewSet
# Other Imports
from rest_framework.routers import DefaultRouter
from django.conf.urls.static import static
from whats_open.settings import local as settings_local
router = DefaultRouter()
router.register(r'categories', CategoryViewSet)
router.register(r'facilities', FacilityViewSet)
router.register(r'schedules', ScheduleViewSet)
#router.register(r'opentimes', OpenTimeViewSet)
# Instiantiate our DefaultRouter
ROUTER = DefaultRouter()
# Register views to the API router
ROUTER.register(r'categories', CategoryViewSet)
ROUTER.register(r'facilities', FacilityViewSet)
ROUTER.register(r'schedules', ScheduleViewSet)
urlpatterns = patterns('website.views',
url(r'^api/', include(router.urls)),
#url(r'^$', 'facility_grid', name='facility_grid'),
)
#facilities open urls
#url(r'^facilities/$', FacilityListView.as_view(), name='faciliites-list'),
#url(r'^facilities/(?P<category>)/$', FacilityCategoryListView.as_view(), name='facilities-list-by-cat'),
#url(r'^facilities/(?P<slug>)/$', FacilityDetailView.as_view(), name='facilities-detail'),
#url(r'^facilities/(?P<on_campus>)/$', FacilityStatusListView.as_view(), name='facilities-list-by-status'),
#schedules urls
#url(r'^schedule/(?P<pk>)/$', ScheduleDetailView.as_view(), name='schedule-detail'),
#opentime urls
#url(r'^open-time/(?P<pk>)/$', OpenTimeDetailView.as_view(), name='open-time-detail'),
#) + static(settings_local.STATIC_URL, document_root=settings_local.STATIC_ROOT)
urlpatterns = [
# /api - Root API URL
url(r'^api/', include(ROUTER.urls)),
]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment