scholrly / neo4django

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

Several .filter problems #242

Open tonjo opened 10 years ago

tonjo commented 10 years ago

Seems like .filter is broken. On relationship and on models, there are so many issues. We should re-open issue #219, because #234 didn't resolve all the problems.
Sometimes it will simply not work, sometimes it will raise gremlin-related exception. I Have:

from django.utils import timezone
now = timezone.now()

Being evstart and evend two datetime fields, and events a relationship to a Event model, this simple chain on a relationship shows no results:

myModel.events.filter(evstart__lte=now).filter(evend__gte=now)

Don't know why, but this one works:

myModel.events.filter(evstart__lte=now)

while the following does not:

myModel.events.filter(evend__gte=now)

There ARE event in the selected time period, this is sure. The same filtering sometimes it works on Model instead of Relationship, but not always. With works I mean it gives expected results.

Furthermore, considering no .exclude is implemented ( #213), it's really hard to do something good. @mhluongo, I wish I could help, I imagine you don't have much time. The project seems a bit on its own without you ;)