from xadmin.plugins.utils import get_context_dict
def block_top_toolbar(self, context, nodes):
context = get_context_dict(context or {}) # 用此方法来转换
nodes.append(loader.render_to_string('xadmin/excel/model_list.top_toolbar.import.html',context=context))