def database_search_view(request): """ @ 信息系统页面 :param request: :return: html """ if request.method == 'POST': sql_params = sql_search_params(request) object_list = api_action('database.search', sql_params) object_list, p, objects, page_range, current_page, show_first, show_end = pages(object_list, sql_params['current_page']) result = list(objects) content_html = render_to_string('page.html', locals()) return JsonResponse(data={'result': result, 'content_html': content_html}, status=200, safe=False)
def database_list_view(request): """ @ 信息系统页面 :param request: :return: html """ if request.method == 'GET': sql_params = sql_get_params(request) content_params = DatabaseRelated().get_list_related() object_list = api_action('database.get', sql_params) object_list, p, objects, page_range, current_page, show_first, show_end = pages(object_list) content_params = format_content_dict(content_params,object_list, p, objects, page_range, current_page, show_first, show_end) return render_to_response('cmdb/database/database_list.html', content_params)