cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

OGM using python's neomodel

Hi, I'm using neomodel's OGM and have a few questions.

  1. Is it recommended for production usage?
  2. Would you pick it over py2neo's OGM?
  3. My model requires multi inheritence.
    e.g.
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

3 REPLIES 3

scirat
Node Link

Neomodel does not provide the __abstract__ property, but __abstract_node__
So: in your case: __abstract_node__ = True
I hope it helps..

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.

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!!