我无法使用MongoEngine从mongodb获取对象: 当我打电话的时候BaseForm.objects.all()它引发了一个异常:
...
obj = cls(__auto_convert=False, _created=created, __only_fields=only_fields, **data)
TypeError: __init__() got an unexpected keyword argument '__auto_convert'
在mongodb中,控制台记录被正确显示。你知道吗
我的型号:
class BaseController(db.EmbeddedDocument):
title = db.StringField(max_length=255, required=True)
type = db.StringField(max_length=255, required=True)
def __unicode__(self):
return self.title
meta = {'allow_inheritance': True}
class RadioButton(BaseController):
def __init__(self, title):
super(BaseController, self).__init__()
self.title = title
self.type = 'radiobutton'
class CheckBox(BaseController):
def __init__(self, title):
super(BaseController, self).__init__()
self.title = title
self.type = 'checkbox'
class BaseFormController(db.EmbeddedDocument):
title = db.StringField(max_length=255, required=True)
controllers = db.ListField(db.EmbeddedDocumentField('BaseController'))
def __unicode__(self):
return self.title
meta = {'allow_inheritance': True}
class BaseForm(db.Document):
title = db.StringField(max_length=255, required=True)
controllers = db.ListField(db.EmbeddedDocumentField('BaseFormController'))
def __unicode__(self):
return self.title
meta = {'allow_inheritance': True}
目前没有回答
相关问题 更多 >
编程相关推荐