order LocationGroups by their category first

This commit is contained in:
Laura Klünder 2017-07-11 17:41:16 +02:00
parent 47a2a713f6
commit 5d336d218a
2 changed files with 20 additions and 1 deletions

View file

@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-07-11 15:41
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('mapdata', '0022_remove_space_category'),
]
operations = [
migrations.AlterModelOptions(
name='locationgroup',
options={'ordering': ('-category__priority', '-priority'), 'verbose_name': 'Location Group', 'verbose_name_plural': 'Location Groups'},
),
]

View file

@ -185,7 +185,7 @@ class LocationGroup(Location, models.Model):
verbose_name = _('Location Group')
verbose_name_plural = _('Location Groups')
default_related_name = 'locationgroups'
ordering = ('-priority',)
ordering = ('-category__priority', '-priority')
def _serialize(self, **kwargs):
result = super()._serialize(**kwargs)