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
1d460986
Commit
1d460986
authored
Jan 18, 2019
by
许俊鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
合并批量修改帖子的方法
parent
c195ddac
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
20 deletions
+0
-20
topic.py
api/topic.py
+0
-19
urls.py
api/urls.py
+0
-1
No files found.
api/topic.py
View file @
1d460986
...
@@ -110,24 +110,6 @@ class ReplyCreate(APIView):
...
@@ -110,24 +110,6 @@ class ReplyCreate(APIView):
class
TopicListBatchUpdate
(
APIView
):
class
TopicListBatchUpdate
(
APIView
):
def
post
(
self
,
request
):
ids
=
request
.
POST
.
get
(
'ids'
,
''
)
.
split
()
type
=
request
.
POST
.
get
(
'type'
)
updates
=
{}
if
type
==
'offline'
:
updates
[
'is_online'
]
=
False
else
:
updates
[
'is_online'
]
=
True
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"
:
"更新成功"
}
class
TopicListBatchUpdate_new
(
APIView
):
def
post
(
self
,
request
):
def
post
(
self
,
request
):
ids
=
request
.
POST
.
get
(
'ids'
,
''
)
.
split
()
ids
=
request
.
POST
.
get
(
'ids'
,
''
)
.
split
()
...
@@ -140,4 +122,3 @@ class TopicListBatchUpdate_new(APIView):
...
@@ -140,4 +122,3 @@ class TopicListBatchUpdate_new(APIView):
return
{
return
{
"message"
:
"更新成功"
"message"
:
"更新成功"
}
}
api/urls.py
View file @
1d460986
...
@@ -55,7 +55,6 @@ urlpatterns = [
...
@@ -55,7 +55,6 @@ urlpatterns = [
url
(
r'^topic/reply/list$'
,
ReplyUpdateOrCreateView
.
as_view
()),
url
(
r'^topic/reply/list$'
,
ReplyUpdateOrCreateView
.
as_view
()),
url
(
r'^topic/reply/batch_delete$'
,
ReplyUpdateOrCreateView
.
as_view
()),
url
(
r'^topic/reply/batch_delete$'
,
ReplyUpdateOrCreateView
.
as_view
()),
url
(
r'^topic/reply/create$'
,
ReplyCreate
.
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相关
# star相关
url
(
r'^celebrity/list$'
,
CelebrityListView
.
as_view
()),
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