main.py 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. """
  4. demeter web page
  5. name:main.py
  6. author:rabin
  7. """
  8. from __load__ import *
  9. class index_path(Load):
  10. @Web.setting
  11. def get(self):
  12. # 获取焦点图
  13. self.data['focus'] = self.service('common').list('web_article', search={'category_id':5})
  14. if self.data['focus']:
  15. for key, value in enumerate(self.data['focus']):
  16. self.data['focus'][key]['link'] = 'javascript:;'
  17. if value['link']:
  18. self.data['focus'][key]['link'] = value['link']
  19. # 获取产品功能
  20. self.data['function'] = self.service('common').list('web_article', search={'category_id':3})
  21. if self.data['function']:
  22. for key, value in enumerate(self.data['function']):
  23. self.data['function'][key]['link'] = '#'
  24. if value['link']:
  25. self.data['function'][key]['link'] = value['link']
  26. # 获取客户案例
  27. self.data['demo'] = self.service('common').list('web_article', search={'category_id':4})
  28. if self.data['demo']:
  29. for key, value in enumerate(self.data['demo']):
  30. self.data['demo'][key]['link'] = '#'
  31. if value['link']:
  32. self.data['demo'][key]['link'] = value['link']
  33. self.view("index.html")