google-app-engine-django 加载装置
我在使用 google-app-engine-django 在 GAE 上加载固定装置时遇到问题。我收到一条错误消息“DeserializationError:无效的模型标识符:'fcl.User'”
<块引用> <块引用>./manage.py 加载数据用户
我正在尝试加载具有以下数据的装置:
- model: fcl.User fields: firstname: test lastname: testerson email: [email protected] user_id: '981167207188616462253' status: active usertype: player creationtime: '2010-08-29 00:00:00'
我需要对我的模型名称进行任何其他限定吗?夹具位于 fcl/fixtures/users.yaml,模型位于“fcl/models.py”。
任何帮助将不胜感激。
I'm having troubles loading fixtures on GAE with google-app-engine-django. I receive an error that says "DeserializationError: Invalid model identifier: 'fcl.User'"
./manage.py loaddata users
I'm trying to load a fixture that has the following data:
- model: fcl.User fields: firstname: test lastname: testerson email: [email protected] user_id: '981167207188616462253' status: active usertype: player creationtime: '2010-08-29 00:00:00'
do I need to do any other qualifying of my model name? The fixture lives at fcl/fixtures/users.yaml and model lives in at 'fcl/models.py'.
Any help would be greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
事实证明,这个问题是因为我没有在 models.py 中正确声明我的模型而引起的。
当使用 google-app-engine-django 时,每个模型应该是以下子类:
修复此问题后,它可以工作。我还需要在我的装置中放置一个有效的 pk: 值。
Turns out the issue was caused because I wasn't declaring my model correctly in models.py
When using google-app-engine-django, each model should be a subclass of:
after fixing this, it works. I also needed to put a valid pk: value in my fixture.