Python Django、South和Guardian:迁移
我有两个用户,mh00h1和mh00h2。我还有modelA,它在my models.py中定义了以下内容:Python Django、South和Guardian:迁移,python,django,django-south,django-guardian,Python,Django,Django South,Django Guardian,我有两个用户,mh00h1和mh00h2。我还有modelA,它在my models.py中定义了以下内容: class Meta: permissions = ( ('read','read'), ('write','write'), ) 从shell中,我转到设置权限: >>>> frhde = create modelA instance >>>> assign_perm('read', mh
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>}
我如何让schematicmigration正确更新数据库,或者有没有更好的方法不需要重做整个数据库
谢谢。您可以使用
/manage.py syncdb--all
,或创建类似于中的信号。您还可以使用的更新\u权限
管理命令。
$ /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)