0

Is it possible to get the type of a property in neomodel? For example something like this:

for n in MyNodeModel.properties: 
    if n == StructuredNode:
        print('StructuredNode')

I hope my questions is clear...

  • Well if `n` is a property, why can't you just use `type(n)`? https://docs.python.org/2/library/functions.html#type – FrobberOfBits Dec 19 '14 at 22:30
  • That's the point. I want something like .properties so I can use type or something. –  Dec 20 '14 at 17:04

1 Answers1

0

Sure you just need to get the property object from the model:

if isinstance(MyNodeModel.your_property, StringProperty):
    print("a string")

If this doesn't answer your question please open an issue on github

rob
  • 384
  • 1
  • 3