Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
sun
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alpha
sun
Commits
bc90e915
Commit
bc90e915
authored
Oct 12, 2019
by
杨成林
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'ycl/survey' into 'test'
answers_add See merge request
!371
parents
70bb8755
47ad95cd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
3 deletions
+13
-3
survey.py
api/survey.py
+12
-3
urls.py
api/urls.py
+1
-0
No files found.
api/survey.py
View file @
bc90e915
...
...
@@ -31,10 +31,19 @@ class SurveyView(APIView):
"template_id"
:
int
(
request
.
POST
.
get
(
'template_id'
,
0
)),
}
self
.
rpc
[
'venus/sun/survey/add'
](
data
=
data
)
.
unwrap
()
data
=
self
.
rpc
[
'venus/sun/survey/add'
](
data
=
data
)
.
unwrap
()
return
data
class
SurveyAddAnswerView
(
APIView
):
def
post
(
self
,
request
):
answers
=
json
.
loads
(
request
.
POST
.
get
(
'answers'
))
self
.
rpc
[
'venus/sun/survey/answers_add'
](
data
=
answers
)
.
unwrap
()
return
{
"status"
:
1
}
api/urls.py
View file @
bc90e915
...
...
@@ -252,6 +252,7 @@ urlpatterns = [
url
(
r'^survey_question/create$'
,
SurveyView
.
as_view
()),
url
(
r'^survey_question/get$'
,
SurveyView
.
as_view
()),
url
(
r'^survey_question/list$'
,
SurveyListView
.
as_view
()),
url
(
r'^survey_question/add_answer$'
,
SurveyAddAnswerView
.
as_view
()),
]
search_urlpatterns
=
[
...
...
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