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
c5a37760
Commit
c5a37760
authored
May 21, 2019
by
王浩
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'haow/user_sex' into 'test'
user list add gender filter See merge request
alpha/sun!209
parents
3b1ac408
6e1c53a0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
user.py
api/user.py
+6
-3
No files found.
api/user.py
View file @
c5a37760
...
...
@@ -19,13 +19,16 @@ from utils.pic_tools import tailor_image
class
UserListView
(
APIView
):
def
get
(
self
,
request
):
pictorial_id
=
request
.
GET
.
get
(
'pictorial_id'
,
''
)
gender
=
request
.
GET
.
get
(
'gender'
,
None
)
page
=
int
(
request
.
GET
.
get
(
'page'
,
1
))
limit
=
int
(
request
.
GET
.
get
(
'limit'
,
10
))
filter
=
self
.
handle_filter
(
request
.
GET
.
get
(
'filter'
,
'{}'
))
filter
s
=
self
.
handle_filter
(
request
.
GET
.
get
(
'filter'
,
'{}'
))
if
pictorial_id
:
filter
.
update
({
'pictorial_id'
:
pictorial_id
})
filters
.
update
({
'pictorial_id'
:
pictorial_id
})
if
gender
:
filters
.
update
({
'gender'
:
gender
})
try
:
data
=
self
.
rpc
[
'venus/sun/user/list'
](
offset
=
(
page
-
1
)
*
limit
,
limit
=
limit
,
filters
=
filter
)
.
unwrap
()
data
=
self
.
rpc
[
'venus/sun/user/list'
](
offset
=
(
page
-
1
)
*
limit
,
limit
=
limit
,
filters
=
filter
s
)
.
unwrap
()
except
Exception
as
e
:
error_logger
.
error
(
u'获取用户列表失败
%
s'
,
e
)
raise
...
...
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