From 3870b70c6ebfd4188ebee5a2503a4221b666c38a Mon Sep 17 00:00:00 2001 From: Ian Ross Date: Thu, 20 Oct 2016 18:53:25 +0200 Subject: [PATCH 1/2] Try to fix non-determinism in tests --- .../migrations/0004_auto_20161020_1648.py | 23 +++++++++++++++++++ cadasta/resources/models.py | 3 +++ 2 files changed, 26 insertions(+) create mode 100644 cadasta/resources/migrations/0004_auto_20161020_1648.py diff --git a/cadasta/resources/migrations/0004_auto_20161020_1648.py b/cadasta/resources/migrations/0004_auto_20161020_1648.py new file mode 100644 index 000000000..9be0944a6 --- /dev/null +++ b/cadasta/resources/migrations/0004_auto_20161020_1648.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') From a0c0549447db789c564c345f129f61701ad5a6d4 Mon Sep 17 00:00:00 2001 From: Ian Ross Date: Thu, 20 Oct 2016 19:05:03 +0200 Subject: [PATCH 2/2] Rename migration --- ...4_auto_20161020_1648.py => 0004_add_ordering_for_resources.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename cadasta/resources/migrations/{0004_auto_20161020_1648.py => 0004_add_ordering_for_resources.py} (100%) diff --git a/cadasta/resources/migrations/0004_auto_20161020_1648.py b/cadasta/resources/migrations/0004_add_ordering_for_resources.py similarity index 100% rename from cadasta/resources/migrations/0004_auto_20161020_1648.py rename to cadasta/resources/migrations/0004_add_ordering_for_resources.py