12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- """
- demeter web page
- name:package.py 版本相关
- author:rabin
- """
- from __load__ import *
- class version_path(Load):
- @Web.auth
- @Web.setting
- def get(self):
- self.common(
- name = u'版本'
- ,path = '/package/version'
- ,width = '600'
- ,height = '600'
- ,search = (('package_id-select-','name-input-mlike','version-input-mlike'), (u'选择Package', u'版本名称', u'版本号'))
- ,thead = (u'所属Package', u'版本名称', u'版本号', u'创建时间')
- ,tbody = ('package','name', 'version', 'cdate')
- ,state = False
- )
- self.data['common']['search_package-select-'] = self.service('common').list('package')
- self.commonList('package_version')
- if self.data['list']:
- for key, value in enumerate(self.data['list']):
- package = self.service('common').one('package', id=value['package_id'])
- self.data['list'][key]['package'] = package['name']
- self.commonView('list')
- class version_update_path(Load):
- @Web.auth
- @Web.setting
- def get(self):
- self.common(
- path = '/package/version'
- ,label = (u'所属Package',u'版本名称',u'版本号')
- ,update = ('package_id-select','name-input-required','name-input-required')
- ,update_package_id = self.service('common').list('package')
- )
- self.commonOne('package_version')
- self.commonView('update')
- @Web.auth
- @Web.setting
- def post(self):
- self.commonUpdate('package_version')
- @Web.auth
- @Web.setting
- def delete(self):
- self.commonDelete('package_version')
- class package_path(Load):
- @Web.auth
- @Web.setting
- def get(self):
- self.common(
- name = u'Package'
- ,path = '/package/package'
- ,width = '600'
- ,height = '300'
- ,search = (('name-input-mlike','url-input-mlike'), (u'名称',u'地址'))
- ,thead = (u'ID', u'名称',u'地址', u'更新时间')
- ,tbody = ('id', 'name', 'url', 'cdate')
- ,state = False
- )
- self.commonList('package')
- self.commonView('list')
- class package_update_path(Load):
- @Web.auth
- @Web.setting
- def get(self):
- self.common(
- path = '/package/package'
- ,label = (u'名称', u'地址')
- ,update = ('name-input-required', 'url-input-required')
- )
- self.commonOne('package')
- self.commonView('update')
- @Web.auth
- @Web.setting
- def post(self):
- self.commonUpdate('package')
- @Web.auth
- @Web.setting
- def delete(self):
- self.commonDelete('package')
|