Skip to content

Commit

Permalink
Merge pull request #229 from coffenbacher/singlenode-form-save
Browse files Browse the repository at this point in the history
Adding the save_form_data method to SingleNode, fixing issue #228
  • Loading branch information
mhluongo committed Dec 30, 2013
2 parents e68936c + d561541 commit f9281b4
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 f9281b4

Please sign in to comment.