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
fd04ea4c
Commit
fd04ea4c
authored
5 years ago
by
zhongshangwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
标签编辑增加参数
parent
8737f61d
master
dev
like-pre/r01
quick-reply
refactor
test
No related merge requests found
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
tag.py
api/tag.py
+9
-1
No files found.
api/tag.py
View file @
fd04ea4c
...
...
@@ -48,11 +48,17 @@ class TagUpdateOrCreateView(APIView):
return
{
'data'
:
data
}
def
post
(
self
,
request
):
id
=
request
.
POST
.
get
(
'id'
)
down_tags
=
list
(
set
(
map
(
lambda
x
:
x
.
split
(
":"
)[
0
],
json
.
loads
((
request
.
POST
.
get
(
'down_tags'
,
'[]'
))))))
up_tags
=
list
(
set
(
map
(
lambda
x
:
x
.
split
(
":"
)[
0
],
json
.
loads
((
request
.
POST
.
get
(
'up_tags'
,
'[]'
))))))
tagtypes
=
list
(
set
(
map
(
lambda
x
:
x
.
split
(
":"
)[
0
],
json
.
loads
((
request
.
POST
.
get
(
'tagtypes'
,
'[]'
))))))
request
.
POST
.
get
(
'official_pictorial_id'
,
''
)
.
split
(
":"
)
official_pictorial_id
=
request
.
POST
.
get
(
'official_pictorial_id'
,
''
)
.
split
(
":"
)
if
official_pictorial_id
:
official_pictorial_id
=
official_pictorial_id
[
0
]
else
:
official_pictorial_id
=
None
data
=
{
'name'
:
request
.
POST
.
get
(
'name'
)
.
lower
(),
...
...
@@ -64,6 +70,8 @@ class TagUpdateOrCreateView(APIView):
'platform'
:
request
.
POST
.
get
(
'platform'
,
1
),
'collection'
:
request
.
POST
.
get
(
'collection'
,
0
),
'alias'
:
request
.
POST
.
get
(
'alias'
,
''
),
'is_core'
:
request
.
POST
.
get
(
'is_core'
,
0
),
'official_pictorial_id'
:
official_pictorial_id
,
'is_show_in_register'
:
request
.
POST
.
get
(
'is_show_in_register'
,
'false'
),
'pictorial_ids'
:
list
(
(
map
(
lambda
x
:
int
(
x
.
split
(
":"
)[
0
]),
json
.
loads
((
request
.
POST
.
get
(
'pictorial_ids'
,
'[]'
))))))
...
...
This diff is collapsed.
Click to expand it.
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