Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2020-1-CloudComputing
/
C_Team_KhuDrive
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
권주희
2020-06-10 22:44:07 +0900
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
79b774eef2ca75a1630f0cb186e08f75f63426af
79b774ee
2 parents
bb18bd85
3616d62e
Merge branch 'feature/item_api' into 'develop'
add get item api See merge request
!7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
backend/api/views.py
backend/api/views.py
View file @
79b774e
...
...
@@ -57,8 +57,12 @@ class ItemViewSet(viewsets.ViewSet):
# url: items/11/
# 마지막 slash도 써주어야함
def
get
(
self
,
request
,
pk
):
print
(
pk
)
return
Response
({
'message'
:
"info complete"
},
status
=
status
.
HTTP_200_OK
)
item
=
Item
.
objects
.
filter
(
item_id
=
pk
)
data
=
serializers
.
serialize
(
"json"
,
item
)
json_data
=
json
.
loads
(
data
)
res
=
json_data
[
0
][
'fields'
]
res
[
'id'
]
=
json_data
[
0
][
'pk'
]
return
Response
({
'data'
:
res
},
status
=
status
.
HTTP_200_OK
)
# url: items/11/
# 마지막 slash도 써주어야함
...
...
Please
register
or
login
to post a comment