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
c195ddac
Commit
c195ddac
authored
Jan 16, 2019
by
许俊鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加批量修改帖子信息
parent
05aa8f11
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
0 deletions
+15
-0
topic.py
api/topic.py
+14
-0
urls.py
api/urls.py
+1
-0
No files found.
api/topic.py
View file @
c195ddac
...
...
@@ -127,3 +127,17 @@ class TopicListBatchUpdate(APIView):
"message"
:
"更新成功"
}
class
TopicListBatchUpdate_new
(
APIView
):
def
post
(
self
,
request
):
ids
=
request
.
POST
.
get
(
'ids'
,
''
)
.
split
()
updates
=
self
.
handle_filter
(
request
.
POST
.
get
(
'updates'
,
"{}"
))
try
:
self
.
rpc
[
'venus/sun/topic/batch/update'
](
updates
=
updates
,
ids
=
ids
)
.
unwrap
()
except
Exception
as
e
:
error_logger
.
error
(
u'批量更新帖子失败
%
s'
,
e
)
raise
return
{
"message"
:
"更新成功"
}
api/urls.py
View file @
c195ddac
...
...
@@ -55,6 +55,7 @@ urlpatterns = [
url
(
r'^topic/reply/list$'
,
ReplyUpdateOrCreateView
.
as_view
()),
url
(
r'^topic/reply/batch_delete$'
,
ReplyUpdateOrCreateView
.
as_view
()),
url
(
r'^topic/reply/create$'
,
ReplyCreate
.
as_view
()),
url
(
r'^topic/batch_update_new$'
,
TopicListBatchUpdate_new
.
as_view
()),
# TODO 后台优化临时需求, 1.2 上线后与topic/batch_update 整合到一起
# star相关
url
(
r'^celebrity/list$'
,
CelebrityListView
.
as_view
()),
...
...
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