Commit aaa50edc authored by Jamesie Pic's avatar Jamesie Pic

Index Group kind and abbreviation

We're matching on them for group list and detail pages ...
parent 113b93f6
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('representatives', '0009_order_mandates_by_end_date_descendant'),
]
operations = [
migrations.AlterModelOptions(
name='mandate',
options={'ordering': ('-end_date',)},
),
migrations.AlterField(
model_name='group',
name='abbreviation',
field=models.CharField(default=b'', max_length=10, db_index=True, blank=True),
),
migrations.AlterField(
model_name='group',
name='kind',
field=models.CharField(max_length=255, db_index=True),
),
]
......@@ -158,8 +158,9 @@ class Group(HashableModel, TimeStampedModel):
An entity represented by a representative through a mandate
"""
name = models.CharField(max_length=255)
abbreviation = models.CharField(max_length=10, blank=True, default='')
kind = models.CharField(max_length=255, blank=True, default='')
abbreviation = models.CharField(max_length=10, blank=True, default='',
db_index=True)
kind = models.CharField(max_length=255, db_index=True)
hashable_fields = ['name', 'abbreviation', 'kind']
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment