123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- # -*- 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.set(
- 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.list('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.show('list')
- class version_update_path(Load):
- @Web.auth
- @Web.setting
- def get(self):
- self.set(
- 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.one('package_version')
- self.show('update')
- @Web.auth
- @Web.setting
- def post(self):
- self.update('package_version')
- @Web.auth
- @Web.setting
- def delete(self):
- self.drop('package_version')
- class package_path(Load):
- @Web.auth
- @Web.setting
- def get(self):
- self.set(
- 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.list('package')
- self.show('list')
- class package_update_path(Load):
- @Web.auth
- @Web.setting
- def get(self):
- self.set(
- path = '/package/package'
- ,label = (u'名称', u'地址')
- ,update = ('name-input-required', 'url-input-required')
- )
- self.one('package')
- self.show('update')
- @Web.auth
- @Web.setting
- def post(self):
- self.update('package')
- @Web.auth
- @Web.setting
- def delete(self):
- self.drop('package')
|