Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
01-22-2019 04:11 AM
Hi, I'm using neomodel's OGM and have a few questions.
class A(StructuredNode):
pass
class B(StructuredNode):
pass
class C(A, B):
__abstract__ = True
pass
Node of type C is a representation of nodes defined with both labels A and B, and abstract is used to specify that C is not an actual label in the graph.
However, when I try to use C.nodes.all() - it will try to query nodes with label C (which does not exist). I may specify label, but I can only assign one label (either A or B). Specifying label = "A:B" will also fail, because it builds the query as follows: "MATCH (a:b:A:B) ..."
How would you achieve correct matching when using label such as C? or is there a better way to achieve it?
Thanks
07-03-2019 07:22 PM
Neomodel does not provide the __abstract__
property, but __abstract_node__
So: in your case: __abstract_node__ = True
I hope it helps..
11-18-2019 09:16 AM
I've been using it in production for approaching 4 years and five projects so its certainly stable.
I picked it over Py2Neo as it works closer to how I code and closer to Django which I have used for those projects.
It does support multiple inheritance but beware that it will create nodes with multiple labels in the case of the example that you have given.
03-14-2020 09:01 AM
Oh, It awsomw to read about using django and neo4j. Im starting to integrate both but Im stuck by creating new nodes. Are you using neomodel? and if yes, are you using django-neomodel also? My dubt is that this last library seems to be outdated and I dont know how to solve this error
NodeMeta' object is not iterable
hope you can help me a bit. Thank you!!
All the sessions of the conference are now available online