urls.py 768 Bytes
Newer Older
1
from django.conf.urls import patterns, include, url
Jason D Yeomans's avatar
Jason D Yeomans committed
2

3 4
from housing.views import ListBuildings, DetailBuilding, ListRooms, DetailRoom
from housing.models import Building, Room, Student
5 6

urlpatterns = patterns('',
7 8 9 10 11 12 13 14 15 16 17 18 19

    url(r'^buildings/$',
        ListBuildings.as_view(
            model=Building,
            #paginate_by='10',
            queryset=Building.objects.all(),
            context_object_name='buildings',
            template_name='listBuildings.html'),
        name='listBuildings'),

    url(r'^buildings/(?P<slug>[\w-]+)/$',
        DetailBuilding.as_view(
            model=Building,
20
            slug_field='slug__iexact',
21 22 23 24
            context_object_name='building',
            template_name='detailBuilding.html'),
        name='detailBuilding'),

25
)