2016-12-04 83 views
0

我有一個名爲TypedItemDjango的自定義權限不添加

class TypedItem(BaseModel): 
    type = models.CharField(choices=['g', 'k'], max_length=1) 

    class Meta(BaseModel.Meta): 
     permissions = [ 
      ('change_type', 'Can change type') 
     ] 

I類叫python manage.py makemigrations,它創建了一個遷移;

migrations.CreateModel(
    name='TypedItem', 
    fields=[ 
     ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 
     ('type', models.CharField(choices=['g', 'k'], default='g', max_length=1)), 
    ], 
    options={ 
     'permissions': [('change_type', 'Can change type')], 
     'abstract': False, 
    }, 
    bases=(dirtyfields.dirtyfields.DirtyFieldsMixin, models.Model), 
), 

但我不能看到我的自定義權限在數據庫中,我叫python manage.py migrate後。我需要額外做些什麼嗎?

Thx。

回答

0

我找到了原因。這是django-admin-view-permission包內的一個錯誤。