nnode._neighbors(nodes, depth + 1)
self.execute("SELECT orig FROM link WHERE targ=%s", (self.id,))
rows = self.cur.fetchall()
for row in rows:
nnode = Node().get_by_id(row[0])
nnode.parent = self.id
nnode._neighbors(nodes, depth + 1)
After Change
return self
def _neighbors(self, nodes, depth=0):
if str(self.d["_id"]) not in nodes.keys():
nodes[str(self.d["_id"])] = self
if (depth < 2):