# HG changeset patch # User casties # Date 1444225260 -7200 # Node ID 09c0a9ceb77890acf18286633b007bf97f7c3343 # Parent ad3eefa2cb80df02d4125313da5ef41f0f852853 more pimping of commentaries_authors. diff -r ad3eefa2cb80 -r 09c0a9ceb778 ismi-python-neo4jrestclient/ismi-vis.py --- a/ismi-python-neo4jrestclient/ismi-vis.py Tue Oct 06 19:26:46 2015 +0200 +++ b/ismi-python-neo4jrestclient/ismi-vis.py Wed Oct 07 15:41:00 2015 +0200 @@ -151,17 +151,21 @@ except KeyError: return [] else: - query = ("MATCH (t:TEXT)-[:was_created_by]->(p:PERSON) " - "WHERE p.ismi_id = {id} " - "RETURN t,p") + query = ("MATCH (t:TEXT)-[:was_created_by]->(p:PERSON {ismi_id: {id}})" + " RETURN t,p,exists((t)-[:is_commentary_on]->()),exists(()-[:is_commentary_on]->(t))") results = gdb.query( query, - returns=(Node,Node), + returns=(Node,Node,bool,bool), params={"id": int(q)} ) # {"name": "(?i).*" + q + ".*"} print("search for %s returned %s results"%(repr(q),len(results))) - return Response(dumps([{"text": text.properties, "author": author.properties} for [text,author] in results]), + data = [{"text": t.properties, + "author": a.properties, + "is_commentary": is_com, + "has_commentaries": has_com} + for [t,a,is_com,has_com] in results] + return Response(dumps(data), mimetype="application/json") diff -r ad3eefa2cb80 -r 09c0a9ceb778 ismi-python-neo4jrestclient/static/commentaries_authors2.html --- a/ismi-python-neo4jrestclient/static/commentaries_authors2.html Tue Oct 06 19:26:46 2015 +0200 +++ b/ismi-python-neo4jrestclient/static/commentaries_authors2.html Wed Oct 07 15:41:00 2015 +0200 @@ -16,7 +16,7 @@
- + @@ -38,7 +38,7 @@
-
Search Results
+
Texts by this author
@@ -55,7 +55,7 @@
-
Details
+
Text details