Commit 6997c166 authored by yangchenglin's avatar yangchenglin

add pictoria search

parent 4c0d5856
......@@ -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
......@@ -229,6 +229,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