scholrly/neo4django — Issue #26: objects.get() doesn't take type into account
Author: mhluongo
Created: 2011-11-13 01:58:25+00:00
State: open

Consider

class C(models.NodeModel):
parent_att = models.IntegerProperty()

class D(C):
child_att = models.IntegerProperty()

>>> c = C.objects.create(parent_att = 5)
>>> d = D.objects.create(parent_att = 5, child_att = 6)
>>> list(D.objects.all())
[]
>>> D.objects.get(parent_att = 5)
MultipleObjectsReturned: get() returned more than one D -- it returned 2! Lookup parameters were {'parent_att': 5}