scholrly / neo4django

Drop-in Neo4j/Django integration.
GNU General Public License v3.0
357 stars 83 forks source link

clear() method on reverse relationship is not working #247

Closed pirhoo closed 10 years ago

pirhoo commented 10 years ago

Hi,

taking the same exemple than the doc:

pete = Person.objects.create(name='Pete', age=30)
garfield = Pet.objects.create()
pete.pets.add(garfield)
pete.save()
# To remove every pets
pete.pets.clear()

The last line throws an exception (from neo4django.db.models.relationships line 745):

<Pet:> is not related to <Person: Pete>

I inspected the RelationshipInstance object and it seems that the self._added is an empty list (even if pete.pets.all() has values).

Any clue?

Best!