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
2b99cb98
Commit
2b99cb98
authored
Jul 02, 2019
by
杨成林
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'ycl/kyc_pictorial' into 'test'
Ycl/kyc pictorial See merge request
!222
parents
e2e172ae
19e9629f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
11 deletions
+15
-11
word_parent.py
api/word_parent.py
+15
-11
No files found.
api/word_parent.py
View file @
2b99cb98
...
...
@@ -27,17 +27,21 @@ class WordParentInfoView(APIView):
class
WordParentCreateView
(
APIView
):
def
post
(
self
,
request
):
name
=
request
.
POST
.
get
(
'name'
,
None
)
children_words
=
json
.
loads
(
request
.
POST
.
get
(
'children_words'
,
'[]'
))
content_ad
=
request
.
POST
.
get
(
'content_ad'
,
''
)
makeup_ad
=
request
.
POST
.
get
(
'makeup_ad'
,
''
)
dress_ad
=
request
.
POST
.
get
(
'dress_ad'
,
''
)
gender
=
request
.
POST
.
get
(
'gender'
,
0
)
if
not
name
:
return
r'缺少参数'
data
=
self
.
rpc
[
'venus/sun/word_parent/add'
](
name
=
name
,
children_words
=
children_words
,
content_ad
=
content_ad
,
makeup_ad
=
makeup_ad
,
dress_ad
=
dress_ad
,
gender
=
gender
)
.
unwrap
()
data
=
{}
data
[
"name"
]
=
request
.
POST
.
get
(
'name'
,
None
)
children_words
=
request
.
POST
.
get
(
'children_words'
)
data
[
"children_words"
]
=
json
.
loads
(
children_words
)
if
children_words
else
[]
data
[
"content_ad"
]
=
request
.
POST
.
get
(
'content_ad'
,
None
)
data
[
"makeup_ad"
]
=
request
.
POST
.
get
(
'makeup_ad'
,
None
)
data
[
"dress_ad"
]
=
request
.
POST
.
get
(
'dress_ad'
,
None
)
data
[
"gender"
]
=
request
.
POST
.
get
(
'gender'
,
None
)
makeup_pictorial_ids
=
request
.
POST
.
get
(
'makeup_pictorial_ids'
)
clothing_pictorial_ids
=
request
.
POST
.
get
(
'clothing_pictorial_ids'
)
data
[
"makeup_pictorial_ids"
]
=
json
.
loads
(
makeup_pictorial_ids
)
if
makeup_pictorial_ids
else
[]
data
[
"clothing_pictorial_ids"
]
=
json
.
loads
(
clothing_pictorial_ids
)
if
clothing_pictorial_ids
else
[]
data
=
self
.
rpc
[
'venus/sun/word_parent/add'
](
data
=
data
)
.
unwrap
()
return
data
...
...
@@ -58,7 +62,7 @@ class WordParentUpdateView(APIView):
makeup_pictorial_ids
=
request
.
POST
.
get
(
'makeup_pictorial_ids'
)
clothing_pictorial_ids
=
request
.
POST
.
get
(
'clothing_pictorial_ids'
)
data
[
"makeup_pictorial_ids"
]
=
json
.
loads
(
makeup_pictorial_ids
)
if
makeup_pictorial_ids
else
[]
data
[
"clothing_pictorial_ids"
]
=
json
(
clothing_pictorial_ids
)
if
clothing_pictorial_ids
else
[]
data
[
"clothing_pictorial_ids"
]
=
json
.
loads
(
clothing_pictorial_ids
)
if
clothing_pictorial_ids
else
[]
data
=
self
.
rpc
[
'venus/sun/word_parent/edit'
](
data
=
data
)
.
unwrap
()
if
not
data
:
...
...
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