package.py 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. """
  4. demeter web page
  5. name:package.py 版本相关
  6. author:rabin
  7. """
  8. from __load__ import *
  9. class version_path(Load):
  10. @Web.auth
  11. @Web.setting
  12. def get(self):
  13. self.common(
  14. name = u'版本'
  15. ,path = '/package/version'
  16. ,width = '600'
  17. ,height = '600'
  18. ,search = (('package_id-select-','name-input-mlike','version-input-mlike'), (u'选择Package', u'版本名称', u'版本号'))
  19. ,thead = (u'所属Package', u'版本名称', u'版本号', u'创建时间')
  20. ,tbody = ('package','name', 'version', 'cdate')
  21. ,state = False
  22. )
  23. self.data['common']['search_package-select-'] = self.service('common').list('package')
  24. self.commonList('package_version')
  25. if self.data['list']:
  26. for key, value in enumerate(self.data['list']):
  27. package = self.service('common').one('package', id=value['package_id'])
  28. self.data['list'][key]['package'] = package['name']
  29. self.commonView('list')
  30. class version_update_path(Load):
  31. @Web.auth
  32. @Web.setting
  33. def get(self):
  34. self.common(
  35. path = '/package/version'
  36. ,label = (u'所属Package',u'版本名称',u'版本号')
  37. ,update = ('package_id-select','name-input-required','name-input-required')
  38. ,update_package_id = self.service('common').list('package')
  39. )
  40. self.commonOne('package_version')
  41. self.commonView('update')
  42. @Web.auth
  43. @Web.setting
  44. def post(self):
  45. self.commonUpdate('package_version')
  46. @Web.auth
  47. @Web.setting
  48. def delete(self):
  49. self.commonDelete('package_version')
  50. class package_path(Load):
  51. @Web.auth
  52. @Web.setting
  53. def get(self):
  54. self.common(
  55. name = u'Package'
  56. ,path = '/package/package'
  57. ,width = '600'
  58. ,height = '300'
  59. ,search = (('name-input-mlike','url-input-mlike'), (u'名称',u'地址'))
  60. ,thead = (u'ID', u'名称',u'地址', u'更新时间')
  61. ,tbody = ('id', 'name', 'url', 'cdate')
  62. ,state = False
  63. )
  64. self.commonList('package')
  65. self.commonView('list')
  66. class package_update_path(Load):
  67. @Web.auth
  68. @Web.setting
  69. def get(self):
  70. self.common(
  71. path = '/package/package'
  72. ,label = (u'名称', u'地址')
  73. ,update = ('name-input-required', 'url-input-required')
  74. )
  75. self.commonOne('package')
  76. self.commonView('update')
  77. @Web.auth
  78. @Web.setting
  79. def post(self):
  80. self.commonUpdate('package')
  81. @Web.auth
  82. @Web.setting
  83. def delete(self):
  84. self.commonDelete('package')