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
0
Merge Requests
0
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
钟尚武
sun
Commits
de6689ba
Commit
de6689ba
authored
Feb 25, 2019
by
王浩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add topic update tag_ids params
parent
5546b257
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
topic.py
api/topic.py
+3
-1
No files found.
api/topic.py
View file @
de6689ba
...
...
@@ -49,7 +49,7 @@ class TopicUpdateOrCreateView(APIView):
topic_images
=
list
(
map
(
lambda
x
:
x
[:
-
2
],
json
.
loads
(
request
.
POST
.
get
(
'topic_images'
,
[]))))
tag_ids
=
list
(
map
(
lambda
x
:
x
.
split
(
':'
)[
0
],
json
.
loads
(
request
.
POST
.
get
(
'tags'
,
'[]'
))))
collection_tag_ids
=
list
(
map
(
lambda
x
:
x
.
split
(
':'
)[
0
],
json
.
loads
(
request
.
POST
.
get
(
'collection_tags'
,
'[]'
))))
tag_ids
=
tag_ids
+
collection_tag_ids
ai_tag_ids
=
list
(
map
(
lambda
x
:
x
.
split
(
':'
)[
0
],
json
.
loads
(
request
.
POST
.
get
(
'ai_tag_ids'
,
'[]'
))))
data
=
{
'topic_images'
:
topic_images
,
...
...
@@ -61,6 +61,8 @@ class TopicUpdateOrCreateView(APIView):
'user_id'
:
request
.
POST
.
get
(
'user'
,
''
)
.
split
(
':'
)[
0
],
'star_id'
:
request
.
POST
.
get
(
'star'
,
''
)
.
split
(
':'
)[
0
],
'tag_ids'
:
tag_ids
,
'collection_tag_ids'
:
collection_tag_ids
,
'ai_tag_ids'
:
ai_tag_ids
,
'is_online'
:
int
(
request
.
POST
.
get
(
'is_online'
)),
'drop_score'
:
int
(
request
.
POST
.
get
(
'drop_score'
)),
'has_image'
:
1
if
topic_images
else
0
,
...
...
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