I'm running the following code:
class Dog(StructuredNode):
name = StringProperty(required=True)
owner = RelationshipTo('Person', 'owner')
class Person(StructuredNode):
name = StringProperty(unique_index=True)
pets = RelationshipFrom('Dog', 'owner')
bob = Person.get_or_create({"name": "Tom"})
bobs_gizmo = Dog.get_or_create({"name": "Gizmo"}, relationship=bob.pets)
tim = Person.get_or_create({"name": "Tim"})
tims_gizmo = Dog.get_or_create({"name": "Gizmo"}, relationship=tim.pets)
# not the same gizmo
assert bobs_gizmo[0] != tims_gismo[0]
tim = Person.get_or_create({"name": "Tim"})
tims_gizmo = Dog.get_or_create({"name": "Gizmo"}, relationship=tim.pets)
get this error:
Traceback (most recent call last):
File "...", line 16, in <module>
bobs_gizmo = Dog.get_or_create({"name": "Gizmo"}, relationship=bob.pets)
AttributeError: 'list' object has no attribute 'pets'
I've tried creating nodes and checked that basic functions work through neomodel.