urls.py 968 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, DetailStudent 
from housing.models import Building, Room, Student 
5 6

urlpatterns = patterns('',
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30

    url(r'^student/(?P<slug>[\w-]+)/$',
        DetailStudent.as_view(
            model=Student,
            context_object_name='student',
            template_name='detailStudent.html'),
        name='detailStudent'),

    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,
            context_object_name='building',
            template_name='detailBuilding.html'),
        name='detailBuilding'),

31
)