Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SRCT
roomlist
Commits
63e34f77
Commit
63e34f77
authored
Aug 01, 2016
by
Daniel W Bond
Browse files
redundant placeholders in the urls
parent
af87d164
Changes
2
Hide whitespace changes
Inline
Side-by-side
roomlist/api/urls.py
View file @
63e34f77
...
...
@@ -10,10 +10,10 @@ from .views import BuildingList, BuildingRetrieve, FloorRetrieve, RoomRetrieve,\
# separate out major and building patterns
building_urls
=
patterns
(
''
,
url
(
r
'^$'
,
BuildingList
.
as_view
(),
name
=
'api_list_buildings'
),
url
(
r
'^
building/(?P<pk>\d
+)/$'
,
BuildingRetrieve
.
as_view
(),
name
=
'api_detail_building'
),
url
(
r
'^building/
floor/
(?P<pk>\d+)/$'
,
FloorRetrieve
.
as_view
(),
name
=
'api_detail_floor'
),
url
(
r
'^
(?P<name>[\w-]
+)/$'
,
BuildingRetrieve
.
as_view
(),
name
=
'api_detail_building'
),
url
(
r
'^building/(?P<pk>\d+)/$'
,
FloorRetrieve
.
as_view
(),
name
=
'api_detail_floor'
),
# 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?
)
...
...
roomlist/api/views.py
View file @
63e34f77
...
...
@@ -29,6 +29,7 @@ class BuildingRetrieve(RetrieveAPIView):
model
=
Building
queryset
=
Building
.
objects
.
all
()
serializer_class
=
BuildingSerializer
lookup_field
=
'name'
#class FloorList(ListAPIView):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment