def ajax_childs(request): key = request.GET.get('key', '') nodes = gen_childs(lbp_settings.LBP_MEDIA_ROOT, key) if not key:#ROOT root_node = {"title": u"目录", "key": "__root__", "isFolder": True, "isLazy": True, "url": "", "children": nodes, } nodes = [root_node] return render_json_response(nodes)
def ajax_medias(request): keys = request.POST.get("keys", ""); keys = keys.split(',') medias = keys2medias(keys, lbp_settings.LBP_MEDIA_ROOT) return render_json_response(medias)