add geo field to nodes

alfred-data
Nils Schneider 2012-06-07 00:02:45 +02:00
parent 32ee0a7032
commit 81b26edbf8
1 changed files with 2 additions and 1 deletions

View File

@ -10,7 +10,8 @@ class D3MapBuilder:
nodes = self._db.get_nodes()
output['nodes'] = [{'group': x.group, 'name': x.name, 'id': x.id,
'macs': ', '.join(x.macs)
'macs': ', '.join(x.macs),
'geo': x.gps.split(" ") if x.gps else None
} for x in nodes if x.online]
output['links'] = [{'source': x.pair[0], 'target': x.pair[1],
'distance': x.distance,