Commit c5a37760 authored by 王浩's avatar 王浩

Merge branch 'haow/user_sex' into 'test'

user list add gender filter

See merge request !209
parents 3b1ac408 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', '{}'))
filters = 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=filters).unwrap()
except Exception as e:
error_logger.error(u'获取用户列表失败%s', e)
raise
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment