Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python Django、South和Guardian:迁移_Python_Django_Django South_Django Guardian - Fatal编程技术网

Python Django、South和Guardian:迁移

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

我有两个用户,mh00h1和mh00h2。我还有modelA,它在my 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>}
我如何让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)