新模型中的模型继承不起作用 [英] Model inheritance in neomodel is not working
本文介绍了新模型中的模型继承不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
现在如果我这样做:
Person.index.get(user_id = id)
返回我的Person对象,但是:
SpecialPerson.index.get(user_id = id)
$给我一个DoesNotExist(在索引匹配查询中找不到节点)异常,这是在neomodel.index.NodeIndexManager中,在$第56行。
我该如何使其工作?
谢谢
解决方案使用 Django Proxy Model 用于扩展功能。
I have a class that does generic stuff, then I inherited another class that adds more functionality to the base one, as following:
Class Person(StructureNode):
....
Class SpecialPerson(Person):
pass
Now if I do :
Person.index.get(user_id=id)
returns my Person object, But:
SpecialPerson.index.get(user_id=id)
gives me a DoesNotExist("Can't find node in index matching query") exception, which is in neomodel.index.NodeIndexManager at line 56.
How can I make it work?
Thank you
解决方案 Use Django Proxy Model for extending functionality.
这篇关于新模型中的模型继承不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文