简体   繁体   English

带有Google App引擎的Django ModelFormSet

[英]Django ModelFormSet with Google app engine

I'm using Django with google app engine. 我将Django与Google App Engine结合使用。 I'm using the google furnished django app engine helper project. 我正在使用Google提供的django应用引擎帮助程序项目。

I'm attempting to create a Django modelformset like this: 我正在尝试创建像这样的Django modelformset:

#MyModel inherits from BaseModel    
MyFormSet = modelformset_factory(models.MyModel)

However, it's failing with this error: 但是,此错误失败:

'ModelOptions' object has no attribute 'fields' 'ModelOptions'对象没有属性'fields'

Apparently modelformset_factory() is expecting MyModel to implement a 'fields' accessor. 显然,modelformset_factory()期望MyModel实现“字段”访问器。

Anybody successfully used a modelformset with GAE datastore? 有人成功使用了GAE数据存储区的modelformset吗? Or is this a fundamental incompatibility between Django and GAE? 还是这与Django和GAE之间的根本不兼容?

It is a fundamental incompatibility between Django and GAE, because they do not share the same interface for their models. 这是Django和GAE之间的根本不兼容性,因为它们的模型没有共享相同的接口。 The django helper does not include a patch for the modelformsets, but django-nonrel probably does, or will eventually. django帮助程序不包括modelformsets的补丁,但django-nonrel可能会或最终会包含。

Since the google team does not spend much time on the django helper any more, you are probably better off looking at django-nonrel http://www.allbuttonspressed.com/projects/django-nonrel unless you want to patch the helper yourself. 由于Google团队不再在django帮助程序上花费太多时间,因此除非您想自己打补丁,否则最好还是去看看django-nonrel http://www.allbuttonspressed.com/projects/django-nonrel

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM