Commit dd3146ee authored by David Haynes's avatar David Haynes 🙆
Browse files

Add cache support to housing app urls.py

parent 886a07d1
# core django imports
from django.conf.urls import patterns, url
from django.views.decorators.cache import cache_page
# imports from your apps
from .views import ListBuildings, DetailBuilding, DetailFloor, DetailRoom
......@@ -10,12 +11,15 @@ urlpatterns = patterns('',
ListBuildings.as_view(), name='list_buildings'),
url(r'^(?P<slug>[\w-]+)/(?P<building>[\w-]+)/$',
DetailBuilding.as_view(), name='detail_building'),
cache_page(60 * 15)(DetailBuilding.as_view()),
name='detail_building'),
url(r'^(?P<slug>[\w-]+)/(?P<building>[\w-]+)/(?P<floor>[\w-]+)/$',
DetailFloor.as_view(), name='detail_floor'),
cache_page(60 * 2)(DetailFloor.as_view()),
name='detail_floor'),
url(r'^(?P<slug>[\w-]+)/(?P<building>[\w-]+)/(?P<floor>[\w-]+)/(?P<room>[\w-]+)/$',
DetailRoom.as_view(), name='detail_room'),
cache_page(60 * 2)(DetailRoom.as_view()),
name='detail_room'),
)
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