diff --git a/cadasta/resources/migrations/0004_add_ordering_for_resources.py b/cadasta/resources/migrations/0004_add_ordering_for_resources.py new file mode 100644 index 000000000..9be0944a6 --- /dev/null +++ b/cadasta/resources/migrations/0004_add_ordering_for_resources.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-10-20 16:48 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('resources', '0003_spatialresource'), + ] + + operations = [ + migrations.AlterModelOptions( + name='resource', + options={'ordering': ('name',)}, + ), + migrations.AlterModelOptions( + name='spatialresource', + options={'ordering': ('name',)}, + ), + ] diff --git a/cadasta/resources/models.py b/cadasta/resources/models.py index dd7c809f2..89014c05a 100644 --- a/cadasta/resources/models.py +++ b/cadasta/resources/models.py @@ -47,6 +47,9 @@ class Resource(RandomIDModel): history = HistoricalRecords() + class Meta: + ordering = ('name',) + class TutelaryMeta: perm_type = 'resource' path_fields = ('project', 'pk')