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
a500ef19
Commit
a500ef19
authored
May 07, 2019
by
haowang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify tag filter create support batch
parent
4909c6ee
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
+11
-7
tag.py
api/tag.py
+11
-7
No files found.
api/tag.py
View file @
a500ef19
...
...
@@ -167,14 +167,18 @@ class TagFilterList(APIView):
class
TagFilterCreate
(
APIView
):
def
post
(
self
,
request
):
tag_name
=
request
.
POST
.
get
(
'tag_name'
,
None
)
tag_id
=
request
.
POST
.
get
(
'tag_id'
,
None
)
if
not
tag_id
or
not
tag_name
:
tag_infos
=
json
.
loads
(
request
.
POST
.
get
(
'tag_infos'
,
'[]'
))
if
not
tag_infos
:
return
{
'message'
:
'参数不完整'
}
data
=
self
.
rpc
[
'venus/sun/tag/filter/add'
](
tag_id
=
tag_id
,
tag_name
=
tag_name
)
.
unwrap
()
if
not
data
:
return
{
'message'
:
'创建失败'
}
for
tag_info
in
tag_infos
:
tag_name
=
tag_info
.
get
(
'tag_name'
,
None
)
tag_id
=
tag_info
.
get
(
'tag_id'
,
None
)
if
not
tag_id
or
not
tag_name
:
return
{
'message'
:
'参数不完整'
}
data
=
self
.
rpc
[
'venus/sun/tag/filter/add'
](
tag_id
=
tag_id
,
tag_name
=
tag_name
)
.
unwrap
()
if
not
data
:
return
{
'message'
:
'创建失败'
}
return
{
'message'
:
'创建成功'
}
...
...
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