0

Am using neo4j 1.9.4, django 1.5 and neo4django 1.8 (recently cloned from github).

I have this:

FRIENDSHIP_REQUESTS_RELATIONS_TYPE = 'wants_to_be_friend_of'
sended_friendship_requests = models.Relationship('self', rel_type=FRIENDSHIP_REQUESTS_RELATIONS_TYPE, related_single=True)

And in a piece of code inside a method on the same model class:

self.node.relationships.create(self.FRIENDSHIP_REQUESTS_RELATIONS_TYPE, target_profile.node, status = self.NEW, created_at=timezone.now(), msg=msg)

The only thing a little "rare" here is the access to neo4j-rest-client for supply the properties on relationships like Matt Luongo suggest in his answer here

Then when i try:

 profile.sended_friendship_requests.remove(self)

Nothing happens. No erros, no warnings, but the relationships remains the same. Personaly i dont think this is related to these because the version of neo4django that i am using have fixed it. I suspect i will have to access neo4j-rest-client again in orden to delete the relationship but am new in almost all these tecnologies and dont know how to proceed.

I had been tracing the remove method inside RelationshipInstance class from /usr/local/lib/python2.7/dist-packages/neo4django-0.1.8-py2.7.egg/neo4django/db/models/relationships.py and everything goes perfect. The method is running completly in the way i assume had designed but then i wonder what could be happen here. At the end the method just do this:

...
    self._removed.append(candidate_rels.pop(0))
...
self._remove_from_cache(obj)

Apparently this is all you need to remove a relationship but for me it is not working. I am needing some help here!

Community
  • 1
  • 1
rolando
  • 31
  • 3

1 Answers1

0

Newbie mistake. Solved adding:

profile.save()

Shame on me!

rolando
  • 31
  • 3