topic.py 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. # **************************************************************************
  4. # Copyright © 2016 jianglin
  5. # File Name: topic.py
  6. # Author: jianglin
  7. # Email: xiyang0807@gmail.com
  8. # Created: 2016-12-17 13:01:43 (CST)
  9. # Last Update:星期六 2017-3-25 19:37:7 (CST)
  10. # By:
  11. # Description:
  12. # **************************************************************************
  13. from .views import BaseView
  14. from forums.extension import db
  15. from forums.api.topic.models import Topic, Collect, Reply
  16. from forums.api.tag.models import Tags
  17. class TopicView(BaseView):
  18. pass
  19. class CollectView(BaseView):
  20. pass
  21. class ReplyView(BaseView):
  22. pass
  23. class TagView(BaseView):
  24. pass
  25. def register_topic(admin):
  26. admin.add_view(
  27. TopicView(
  28. Topic,
  29. db.session,
  30. name='管理问题',
  31. endpoint='admin_topic',
  32. category='管理主题'))
  33. admin.add_view(
  34. CollectView(
  35. Collect,
  36. db.session,
  37. name='管理收藏',
  38. endpoint='admin_collect',
  39. category='管理主题'))
  40. admin.add_view(
  41. ReplyView(
  42. Reply,
  43. db.session,
  44. name='管理回复',
  45. endpoint='admin_reply',
  46. category='管理主题'))
  47. admin.add_view(
  48. TagView(
  49. Tags,
  50. db.session,
  51. name='管理节点',
  52. endpoint='admin_tags',
  53. category='管理主题'))