我有两个用户,mh00h1和mh00h2。我还有modelA,它在我的models.py中定义了以下内容:
class Meta:
permissions = (
('read','read'),
('write','write'),
)
从shell开始,我去设置权限:
>>>> frhde = create modelA instance
>>>> assign_perm('read', mh00h2, frhde)
DoesNotExist: Permission matching query does not exist. Lookup parameters were {'codename': u'read', 'content_type': <ContentType: modelA>}
我意识到South
在class Meta
添加到modelA
并且确认了这一点后,我没有迁移我的模型。将read
更改为read2
表示South
未检测到更改。
$ /manage.py schemamigration myapp --auto
Running migrations for myapp:
- Nothing to migrate.
- Loading initial data for myapp.
Installed 0 object(s) from 0 fixture(s)
Running migrations for guardian:
- Nothing to migrate.
- Loading initial data for guardian.
Installed 0 object(s) from 0 fixture(s)
如何让原型移植正确更新数据库,或者有更好的方法来执行此操作而不需要重做整个数据库?
谢谢。