Added gfk index pair for Role for our access_list queries

This commit is contained in:
Akita Noek 2016-04-25 11:17:15 -04:00
parent 8e4d013342
commit 9df157c971
2 changed files with 7 additions and 0 deletions

View File

@ -129,6 +129,10 @@ class Migration(migrations.Migration):
name='ancestors',
field=models.ManyToManyField(related_name='descendents', through='main.RoleAncestorEntry', to='main.Role'),
),
migrations.AlterIndexTogether(
name='role',
index_together=set([('content_type', 'object_id')]),
),
migrations.AlterIndexTogether(
name='roleancestorentry',
index_together=set([('ancestor', 'content_type_id', 'object_id'), ('ancestor', 'content_type_id', 'role_field'), ('ancestor', 'descendent')]),

View File

@ -106,6 +106,9 @@ class Role(models.Model):
app_label = 'main'
verbose_name_plural = _('roles')
db_table = 'main_rbac_roles'
index_together = [
("content_type", "object_id")
]
role_field = models.TextField(null=False)
singleton_name = models.TextField(null=True, default=None, db_index=True, unique=True)