views.py 810 B

123456789101112131415161718192021222324252627
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. # **************************************************************************
  4. # Copyright © 2017 jianglin
  5. # File Name: views.py
  6. # Author: jianglin
  7. # Email: xiyang0807@gmail.com
  8. # Created: 2017-03-31 17:26:28 (CST)
  9. # Last Update:星期五 2017-3-31 17:48:23 (CST)
  10. # By:
  11. # Description:
  12. # **************************************************************************
  13. from flask import request
  14. from forums.common.views import BaseMethodView as MethodView
  15. from forums.api.topic.models import Topic
  16. class SearchView(MethodView):
  17. def get(self):
  18. query_dict = request.data
  19. search = query_dict.pop('key', None)
  20. results = Topic.query.whoosh_search('第一').all()
  21. print(results)
  22. return ''
  23. def post(self):
  24. pass