From f799a47dbba53c72b23162a30f2c8305579fddf7 Mon Sep 17 00:00:00 2001 From: "J.-S. Caux" <J.S.Caux@uva.nl> Date: Fri, 23 Nov 2018 10:00:50 +0100 Subject: [PATCH] Add ordering of preprints --- .../migrations/0009_auto_20181123_1000.py | 19 +++++++++++++++++++ preprints/models.py | 4 ++++ 2 files changed, 23 insertions(+) create mode 100644 preprints/migrations/0009_auto_20181123_1000.py diff --git a/preprints/migrations/0009_auto_20181123_1000.py b/preprints/migrations/0009_auto_20181123_1000.py new file mode 100644 index 000000000..8ef8494fa --- /dev/null +++ b/preprints/migrations/0009_auto_20181123_1000.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.4 on 2018-11-23 09:00 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('preprints', '0008_auto_20180913_2112'), + ] + + operations = [ + migrations.AlterModelOptions( + name='preprint', + options={'ordering': ['-identifier_w_vn_nr']}, + ), + ] diff --git a/preprints/models.py b/preprints/models.py index 41e898085..443f8ddc5 100644 --- a/preprints/models.py +++ b/preprints/models.py @@ -32,6 +32,10 @@ class Preprint(models.Model): modified = models.DateTimeField(auto_now=True) created = models.DateTimeField(auto_now_add=True) + class Meta: + ordering = ['-identifier_w_vn_nr'] + + def __str__(self): return 'Preprint {}'.format(self.identifier_w_vn_nr) -- GitLab