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
9e6cb81b
Commit
9e6cb81b
authored
Mar 18, 2019
by
王浩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add pictorial topics api
parent
ba5e8f67
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
1 deletion
+20
-1
pictorial.py
api/pictorial.py
+19
-1
urls.py
api/urls.py
+1
-0
No files found.
api/pictorial.py
View file @
9e6cb81b
...
...
@@ -59,7 +59,25 @@ class PictorialUpdateOrCreate(APIView):
'icon'
:
request
.
POST
.
get
(
'icon'
,
''
)
}
try
:
self
.
rpc
[
'venus/sun/pictorial/edit'
](
id
=
id
,
data
=
data
)
.
unwrap
()
error
,
data
=
self
.
rpc
[
'venus/sun/pictorial/edit'
](
id
=
id
,
data
=
data
)
.
unwrap
()
except
Exception
as
e
:
error_logger
.
error
(
u'编辑
%
s用户信息失败
%
s'
%
(
id
,
e
))
raise
return
{
'message'
:
'更新成功'
,
'data'
:
data
}
class
PictorialTopics
(
APIView
):
"""创建画报和多个帖子关系"""
def
post
(
self
,
request
):
topic_ids
=
json
.
loads
(
request
.
POST
.
get
(
'topic_ids'
,
'[]'
))
pictorial_id
=
request
.
POST
.
get
(
'pictorial_id'
)
try
:
self
.
rpc
[
'venus/sun/pictorial/add_topics'
](
topic_ids
=
topic_ids
,
pictorial_id
=
pictorial_id
)
.
unwrap
()
except
Exception
as
e
:
error_logger
.
error
(
u'编辑
%
s用户信息失败
%
s'
%
(
id
,
e
))
raise
...
...
api/urls.py
View file @
9e6cb81b
...
...
@@ -135,6 +135,7 @@ urlpatterns = [
url
(
r'^pictorial/list/update$'
,
PictorialListView
.
as_view
()),
url
(
r'^pictorial/get$'
,
PictorialUpdateOrCreate
.
as_view
()),
url
(
r'^pictorial/create$'
,
PictorialUpdateOrCreate
.
as_view
()),
url
(
r'^pictorial/topics$'
,
PictorialTopics
.
as_view
()),
]
search_urlpatterns
=
[
...
...
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