urls.py 867 Bytes
Newer Older
1
2
# standard library imports
from __future__ import absolute_import, print_function
3
# core django imports
Daniel W Bond's avatar
Daniel W Bond committed
4
from django.conf.urls import patterns, url
5
from django.views.decorators.cache import cache_page
6
7
# imports from your apps
from .views import ListBuildings, DetailBuilding, DetailFloor, DetailRoom
Jason D Yeomans's avatar
Jason D Yeomans committed
8

9
10

urlpatterns = patterns('',
11

Daniel W Bond's avatar
Daniel W Bond committed
12
    url(r'^$',
13
        ListBuildings.as_view(), name='list_buildings'),
14

15
    url(r'^(?P<slug>[\w-]+)/(?P<building>[\w-]+)/$',
16
17
        cache_page(60 * 15)(DetailBuilding.as_view()),
        name='detail_building'),
18

19
    url(r'^(?P<slug>[\w-]+)/(?P<building>[\w-]+)/(?P<floor>[\w-]+)/$',
20
21
        cache_page(60 * 2)(DetailFloor.as_view()),
        name='detail_floor'),
Daniel W Bond's avatar
Daniel W Bond committed
22

23
    url(r'^(?P<slug>[\w-]+)/(?P<building>[\w-]+)/(?P<floor>[\w-]+)/(?P<room>[\w-]+)/$',
24
25
        cache_page(60 * 2)(DetailRoom.as_view()),
        name='detail_room'),
26

27
)