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
1
Merge Requests
1
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
alpha
sun
Commits
6e1c53a0
Commit
6e1c53a0
authored
May 17, 2019
by
haowang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user list add gender filter
parent
db465f29
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 @
6e1c53a0
...
...
@@ -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