我有两个用户,mh00h1 和 mh00h2。我也有在我的 models.py 中定义以下内容的 modelA:
class Meta:
permissions = (
('read','read'),
('write','write'),
)
从一个外壳,我去设置权限:
>>>> 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)
如何获得示意图迁移以正确更新数据库,或者是否有更好的方法来做到这一点,而不需要重做整个数据库?
谢谢你。