article.py 611 B

12345678910111213141516171819202122
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. """
  4. demeter web page
  5. name:origin.py
  6. author:rabin
  7. """
  8. from __load__ import *
  9. class index_path(Load):
  10. @Web.setting
  11. def get(self):
  12. id = self.input('id')
  13. if not id:
  14. self.out('error')
  15. return
  16. self.data['info'] = self.service('common').one('web_article', id=id)
  17. self.data['category'] = self.service('common').list('web_help_category')
  18. if self.data['category']:
  19. for key, value in enumerate(self.data['category']):
  20. self.data['category'][key]['link'] = '/help?category=' + str(value['id'])
  21. self.view("detail.html")