package.py 2.3 KB

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