本文整理汇总了Python中models.Manifest.getValidInstallItems方法的典型用法代码示例。如果您正苦于以下问题:Python Manifest.getValidInstallItems方法的具体用法?Python Manifest.getValidInstallItems怎么用?Python Manifest.getValidInstallItems使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.Manifest
的用法示例。
在下文中一共展示了Manifest.getValidInstallItems方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: detail
# 需要导入模块: from models import Manifest [as 别名]
# 或者: from models.Manifest import getValidInstallItems [as 别名]
def detail(request, manifest_name):
if request.method == 'POST':
if not request.user.has_perm('reports.change_machine'):
return HttpResponse(json.dumps('error'))
if request.is_ajax():
json_data = json.loads(request.raw_post_data)
if json_data:
manifest_detail = Manifest.read(manifest_name)
for key in json_data.keys():
manifest_detail[key] = json_data[key]
Manifest.write(manifest_name, manifest_detail,
request.user)
return HttpResponse(json.dumps('success'))
if request.method == 'GET':
manifest = Manifest.read(manifest_name)
valid_install_items = Manifest.getValidInstallItems(manifest_name)
valid_catalogs = Catalog.list()
valid_manifest_names = Manifest.list()
manifest_user = manifest.get(MANIFEST_USERNAME_KEY, '')
c = RequestContext(request,
{'manifest_name': manifest_name.replace(':', '/'),
'manifest_user': manifest_user,
'manifest_user_is_editable': MANIFEST_USERNAME_IS_EDITABLE,
'manifest': manifest,
'valid_install_items': valid_install_items,
'valid_catalogs': valid_catalogs,
'valid_manifest_names': valid_manifest_names,
'user': request.user,
'page': 'manifests'})
c.update(csrf(request))
return render_to_response('manifests/detail.html', c)