Commit 63e34f77 authored by Daniel W Bond's avatar Daniel W Bond
Browse files

redundant placeholders in the urls

parent af87d164
...@@ -10,10 +10,10 @@ from .views import BuildingList, BuildingRetrieve, FloorRetrieve, RoomRetrieve,\ ...@@ -10,10 +10,10 @@ from .views import BuildingList, BuildingRetrieve, FloorRetrieve, RoomRetrieve,\
# separate out major and building patterns # separate out major and building patterns
building_urls = patterns('', building_urls = patterns('',
url(r'^$', BuildingList.as_view(), name='api_list_buildings'), url(r'^$', BuildingList.as_view(), name='api_list_buildings'),
url(r'^building/(?P<pk>\d+)/$', BuildingRetrieve.as_view(), name='api_detail_building'), url(r'^(?P<name>[\w-]+)/$', BuildingRetrieve.as_view(), name='api_detail_building'),
url(r'^building/floor/(?P<pk>\d+)/$', FloorRetrieve.as_view(), name='api_detail_floor'), url(r'^building/(?P<pk>\d+)/$', FloorRetrieve.as_view(), name='api_detail_floor'),
# list all the floors still? # list all the floors still?
url(r'^building/floor/room/(?P<pk>\d+)/$', RoomRetrieve.as_view(), name='api_deatil_room'), url(r'^building/floor/(?P<pk>\d+)/$', RoomRetrieve.as_view(), name='api_deatil_room'),
# list all the rooms still? # list all the rooms still?
) )
......
...@@ -29,6 +29,7 @@ class BuildingRetrieve(RetrieveAPIView): ...@@ -29,6 +29,7 @@ class BuildingRetrieve(RetrieveAPIView):
model = Building model = Building
queryset = Building.objects.all() queryset = Building.objects.all()
serializer_class = BuildingSerializer serializer_class = BuildingSerializer
lookup_field = 'name'
#class FloorList(ListAPIView): #class FloorList(ListAPIView):
......
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