fix: sort organisations by name within groups

Resolves #115
This commit is contained in:
James Graham
2021-05-09 13:53:07 +01:00
parent 4e87176c17
commit 7f01bff993
2 changed files with 20 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
# Generated by Django 2.2.10 on 2021-05-09 12:51
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('people', '0052_allow_multiple_nationalities'),
]
operations = [
migrations.AlterModelOptions(
name='organisation',
options={'ordering': ['name']},
),
]

View File

@@ -39,6 +39,9 @@ class OrganisationQuestionChoice(QuestionChoice):
class Organisation(models.Model): class Organisation(models.Model):
"""Organisation to which a :class:`Person` belongs.""" """Organisation to which a :class:`Person` belongs."""
class Meta:
ordering = ['name']
name = models.CharField(max_length=255, blank=False, null=False) name = models.CharField(max_length=255, blank=False, null=False)
def __str__(self) -> str: def __str__(self) -> str: