summaryrefslogtreecommitdiff
path: root/objectapp/models.py
diff options
context:
space:
mode:
authorgnowgi <nagarjun@gnowledge.org>2012-05-09 07:43:28 -0700
committergnowgi <nagarjun@gnowledge.org>2012-05-09 07:43:28 -0700
commit07a756ef79ecfe5a697c703ab396d4db3c070049 (patch)
treef71faf7a5bccd8cdc8cd0842b578b308c153309b /objectapp/models.py
parent6b77378be56f722d36459056b7d3083d1a422448 (diff)
parent43c068657437a37489bbaa40e1d34af5f9f312da (diff)
downloadgnowsys-07a756ef79ecfe5a697c703ab396d4db3c070049.tar.gz
Merge pull request #31 from shefalishetty/master
arrow marked added for relations to suggest direction of reading the graph.
Diffstat (limited to 'objectapp/models.py')
-rw-r--r--objectapp/models.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/objectapp/models.py b/objectapp/models.py
index 97501c81..2c56dbf9 100644
--- a/objectapp/models.py
+++ b/objectapp/models.py
@@ -364,6 +364,7 @@ class Gbobject(Node):
g_json = {}
g_json["node_metadata"]= []
g_json["relations"]=[]
+ g_json["relset"]=[]
global counter
global attr_counter
@@ -380,6 +381,7 @@ class Gbobject(Node):
this_node = {"_id":str(self.id),"title":self.title,"screen_name":self.title, "url":self.get_absolute_url(),"expanded":"true"}
g_json["node_metadata"].append(this_node)
+ g_json["relset"].append(self.id)
for key in predicate_id.keys():
if nbh[key]:
@@ -395,7 +397,7 @@ class Gbobject(Node):
# create nodes
g_json["node_metadata"].append({"_id":str(item.id),"screen_name":item.title,"title":self.title, "url":item.get_absolute_url(),"expanded":"false"})
-
+ g_json["relset"].append(item.id)
# g_json[str(key)].append({"from":predicate_id[key] , "to":item.id ,"value":1 })
#create links
g_json["relations"].append({"from":predicate_id[key] ,"type":str(key), "value":1,"to":item.id })