I am using custom permissions in my Django models like this:
class T21Turma(models.Model):
class Meta:
permissions = ((\"can_view_boletim\", \"Can vi
If you want "manage.py migrate" to do everything (without calling syncdb --all). You need to create new permissions with a migration:
user@host> manage.py datamigration myapp add_perm_foo --freeze=contenttypes --freeze=auth
Edit the created file:
class Migration(DataMigration):
def forwards(self, orm):
"Write your forwards methods here."
ct, created = orm['contenttypes.ContentType'].objects.get_or_create(
model='mymodel', app_label='myapp') # model must be lowercase!
perm, created = orm['auth.permission'].objects.get_or_create(
content_type=ct, codename='mymodel_foo', defaults=dict(name=u'Verbose Name'))