示例#1
0
文件: inventory.py 项目: VPAC/lintory
def show_hardware_list(context, object_list, sort="hardware_sort"):
    request = context['request']
    web = webs.hardware_web()
    dict = defaults(context)
    dict['table'] = tables.hardware(request, web, object_list,request.GET.get(sort))
    dict['rows'] = dict['table'].rows
    dict['web'] = web
    dict['sort'] = sort
    return dict
示例#2
0
文件: views.py 项目: VPAC/lintory
def hardware_list(request):
    web = webs.hardware_web()
    filter = filters.hardware(request.GET or None)
    table = tables.hardware(request, web, filter.qs, order_by=request.GET.get('sort'))
    return web.object_list(request, filter.form, table)