1234567891011121314151617181920212223242526272829303132333435 |
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- """
- demeter web page
- name:main.py
- author:rabin
- """
- from __load__ import *
- class index_path(Load):
- @Web.setting
- def get(self):
- # 获取焦点图
- self.data['focus'] = self.service('common').list('web_article', search={'category_id':5})
- if self.data['focus']:
- for key, value in enumerate(self.data['focus']):
- self.data['focus'][key]['link'] = 'javascript:;'
- if value['link']:
- self.data['focus'][key]['link'] = value['link']
- # 获取产品功能
- self.data['function'] = self.service('common').list('web_article', search={'category_id':3})
- if self.data['function']:
- for key, value in enumerate(self.data['function']):
- self.data['function'][key]['link'] = '#'
- if value['link']:
- self.data['function'][key]['link'] = value['link']
- # 获取客户案例
- self.data['demo'] = self.service('common').list('web_article', search={'category_id':4})
- if self.data['demo']:
- for key, value in enumerate(self.data['demo']):
- self.data['demo'][key]['link'] = '#'
- if value['link']:
- self.data['demo'][key]['link'] = value['link']
- self.view("index.html")
|