【发布时间】:2015-02-20 08:04:12
【问题描述】:
我正在尝试使用 Google API django client lib。为了存储我的网络应用程序的每个用户的凭据,设置了一个 Credentials 模型:
from oauth2client.django_orm import CredentialsField
class CredentialsModel(models.Model):
id = models.ForeignKey(User, primary_key=True)
credential = CredentialsField()
但是,在尝试使用 South 迁移添加此模型时,我得到:
Cannot freeze field 'google.credentialsmodel.credential'
(this field has class oauth2client.django_orm.CredentialsField)
South cannot introspect some fields; this is probably because they are custom
fields. If they worked in 0.6 or below, this is because we have removed the
models parser (it often broke things).
To fix this, read http://south.aeracode.org/wiki/MyFieldsDontWork
我阅读了链接的文档,但我不太清楚如何解决这个问题。如何编写自省规则?或者我该如何解决这个问题以简单地添加带有这个时髦字段的模型?
【问题讨论】:
标签: django google-api google-oauth django-south