diff options
| author | Alon Levy <alon@pobox.com> | 2014-12-23 21:53:46 +0200 |
|---|---|---|
| committer | Alon Levy <alon@pobox.com> | 2014-12-23 22:03:17 +0200 |
| commit | f7ff8bc38410c2666665c4c70cc71c17f6eb7835 (patch) | |
| tree | 458bd97cf23a2672102d85babe1deaa2ec581233 /src/server/neo4j_util.py | |
| parent | 3e3944c42517a2745d9dd2312e8c3a571de41863 (diff) | |
use topo_diff for user input changes
pretty large commit, but it mainly boils to
- reusing the same format clone returns to the client for topo_diff
bad bad code introduced mainly in client side, but server wasn't spared:
- graph/commit_topo__diff massages the links too much - this should not
be there at all, it should be in the correct format to begin with.
server code duplication between clone & topo_diff post processing,
should be factored out
on the good side: single transaction whenever user presses enter, and
the correct place to send back any accumulated diffs (other user
changes).
Diffstat (limited to 'src/server/neo4j_util.py')
| -rw-r--r-- | src/server/neo4j_util.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/server/neo4j_util.py b/src/server/neo4j_util.py index 5bc65032..5cd920a1 100644 --- a/src/server/neo4j_util.py +++ b/src/server/neo4j_util.py @@ -185,7 +185,7 @@ def gen_query_create_from_node_map(node_map, input_to_DB_property_map=lambda _: assert len(label) > 2 and label[0].isupper() and label[1:].islower(), 'malformed label: ' + label q_arr = ['create (n:%s {node_attr})' % (quote__backtick(label)), - 'return n.id' + 'return n, labels(n)' ] q = ' '.join(q_arr) @@ -211,7 +211,7 @@ def gen_query_create_from_link_map(link_map, input_to_DB_property_map=lambda _: for l_type, l_set in link_map.items(): q = "match (src {id: {src}.id}),(dst {id: {dst}.id}) " + \ "create (src)-[r:%(__type)s {link_attr}]->(dst) " + \ - "return id(r)" + "return r, src.id, dst.id, type(r)" q = q % {'__type': quote__backtick(l_type)} for link in l_set: |
