在我的项目中,我使用两个依赖项,即Mongoengine和Flask_Restful的资源。
from flask_restful import Resource, Api
from mongoengine import *
当我创建我的课程时,我希望能够从资源和文档(属于Mongoengine)继承它们
class myobject(Resource, Document):
def test(self):
print("works")
当我在main中运行测试功能时,我希望能够打印"工作"
if __name__='__main__:
newOb = myObject
newOb.test()
但作为回报,我收到了这个错误:
TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict)
subclass of the metaclasses of all its bases
任何解决方案?