order LocationGroups by their category first
This commit is contained in:
parent
47a2a713f6
commit
5d336d218a
2 changed files with 20 additions and 1 deletions
19
src/c3nav/mapdata/migrations/0023_auto_20170711_1741.py
Normal file
19
src/c3nav/mapdata/migrations/0023_auto_20170711_1741.py
Normal 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'},
|
||||
),
|
||||
]
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue