Commit 806e1e44 authored by 杨成林's avatar 杨成林

Merge branch 'ycl/fix' into 'test'

add pictoria search

See merge request alpha/sun!273
parents b11fdcce 6997c166
......@@ -107,3 +107,19 @@ class PictorialSearchView(APIView):
return {
'data': ['{id}:{name}'.format(id=search_data['id'], name=search_data['name']) for search_data in data]
}
class PictorialActivitySearchView(APIView):
def get(self, request):
name = request.GET.get('name')
offset, count = get_offset_count(request)
try:
data = self.rpc['venus/sun/activity/pictorial/search'](name=name, offset=offset, count=count).unwrap()
except Exception as e:
raise e
return {
'data': ['{id}:{name}'.format(id=search_data['id'], name=search_data['name']) for search_data in data]
}
\ No newline at end of file
......@@ -227,6 +227,7 @@ search_urlpatterns = [
url(r'search/topic$', TopicSearchView.as_view()),
url(r'search/tagtype$', TagTypeSearchView.as_view()),
url(r'search/pictorial$', PictorialSearchView.as_view()),
url(r'search/pictorial_activity$', PictorialActivitySearchView.as_view()),
]
common_urlpatterns = [
......
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