Order PublicationYears in descending order

This commit is contained in:
Théophile Bastian 2017-09-22 19:16:41 +02:00
parent 7023cac661
commit f0282eb9da
2 changed files with 22 additions and 0 deletions

View file

@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-09-22 17:16
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('mainsite', '0004_publication_in_year_view_anyway'),
]
operations = [
migrations.AlterModelOptions(
name='publicationyear',
options={'ordering': ['-startYear']},
),
]

View file

@ -87,3 +87,6 @@ class PublicationYear(models.Model):
@property @property
def prettyName(self): def prettyName(self):
return '{}{}'.format(self.startYear, self.startYear+1) return '{}{}'.format(self.startYear, self.startYear+1)
class Meta:
ordering = ['-startYear']