From 82569b9cb412b509d88de55bd3f15a9499dfe76e Mon Sep 17 00:00:00 2001 From: shefali shetty Date: Tue, 5 Jun 2012 12:30:30 +0530 Subject: collapsing done with ctrl+click event --- objectapp/models.py | 6 ++++-- objectapp/templates/objectapp/skeleton.html | 5 +++-- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'objectapp') diff --git a/objectapp/models.py b/objectapp/models.py index 2673d1a..495ac82 100644 --- a/objectapp/models.py +++ b/objectapp/models.py @@ -480,6 +480,7 @@ class Gbobject(Node): g_json["node_metadata"].append({"_id":str(predicate_id[key]),"screen_name":key}) g_json["relations"].append({"from":self.id ,"type":str(key),"value":1,"to":predicate_id[key] }) + if not isinstance(nbh[key],basestring): for item in nbh[key]: if isinstance(item,unicode): @@ -516,8 +517,9 @@ class Gbobject(Node): g_json["relations"].append({"from":predicate_id[key] ,"type":str(key) ,"value":1,"to":(str(attr_counter)+"b") }) attr_counter-=1 - except: - pass + except EOFError: + print "Oops! That was no valid number. Try again..." + #print g_json return json.dumps(g_json) diff --git a/objectapp/templates/objectapp/skeleton.html b/objectapp/templates/objectapp/skeleton.html index d60b9ec..78baf08 100644 --- a/objectapp/templates/objectapp/skeleton.html +++ b/objectapp/templates/objectapp/skeleton.html @@ -405,7 +405,7 @@ $(window).bind('keydown',function(event) { metadata=_.union(new_metadata,metadata); relations=_.union(new_relations,relations); - check_Relation(metadata,relations); + relations= check_Relation(metadata,relations); }}); @@ -446,7 +446,7 @@ $(window).bind('keydown',function(event) { metadata=_.union(new_metadata,metadata); relations=_.union(new_relations,relations); - check_Relation(metadata,relations); + relations= check_Relation(metadata,relations); _.each(metadata, function(m){ @@ -592,6 +592,7 @@ function check_Relation(metadata,relations) } }); + return relations; } -- cgit v1.1