def radial_graph(request, agent_id):
agent = get_object_or_404(EconomicAgent, id=agent_id)
agents = agent.with_all_associations()
connections = {}
for agnt in agents:
if agnt not in connections:
connections[agnt] = 0
cxs = [assn.is_associate for assn in agnt.all_has_associates()]
for cx in cxs:
if cx not in connections:
connections[cx] = 0
connections[cx] += 1
return render_to_response("valueaccounting/radial_graph.html", {
"agents": agents,
"root": agent,
}, context_instance=RequestContext(request))
评论列表
文章目录