Skip to content

Commit

Permalink
Adding the save_form_data method to SingleNode, fixing issue #228
Browse files Browse the repository at this point in the history
  • Loading branch information
coffenbacher committed Dec 13, 2013
1 parent 1e030d2 commit d561541
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions neo4django/db/models/relationships.py
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,12 @@ def _save_relationship(self, instance, node, state):
rels.single = self._create_neo_relationship(node, other)
#other._save_neo4j_node(DEFAULT_DB_ALIAS)

def save_form_data(self, instance, data):
# TODO we need a function like _get_relationship that only takes a
# model instance...
state = self._state_for(instance)
self._set_relationship(instance, state, data)

def _set_cached_relationship(self, obj, other):
state = BoundRelationship._state_for(obj)
if self.name in state and state[self.name]:
Expand Down

0 comments on commit d561541

Please sign in to comment.