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:37:02 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
3616d62ee11cfb15fec0b0c2dfde8549107d9c11
3616d62e
1 parent
8f630a3b
add get item api
Show 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 @
3616d62
...
...
@@ -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