From 616b7308cfd1ab4fdde563df56ebb1a9679a0c8b Mon Sep 17 00:00:00 2001 From: Josh Washburne Date: Fri, 19 Jan 2018 12:18:50 -0500 Subject: [PATCH] Change default ordering for SongRequest. --- savepointradio/profiles/migrations/0001_initial.py | 4 ++-- savepointradio/profiles/models.py | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/savepointradio/profiles/migrations/0001_initial.py b/savepointradio/profiles/migrations/0001_initial.py index 9a53e86..993afaf 100644 --- a/savepointradio/profiles/migrations/0001_initial.py +++ b/savepointradio/profiles/migrations/0001_initial.py @@ -1,4 +1,4 @@ -# Generated by Django 2.0 on 2018-01-18 17:36 +# Generated by Django 2.0 on 2018-01-19 16:46 from django.conf import settings import django.core.validators @@ -54,7 +54,7 @@ class Migration(migrations.Migration): ('song', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='radio.Song')), ], options={ - 'abstract': False, + 'ordering': ['-created_date'], }, ), migrations.AddField( diff --git a/savepointradio/profiles/models.py b/savepointradio/profiles/models.py index 8950329..691a451 100644 --- a/savepointradio/profiles/models.py +++ b/savepointradio/profiles/models.py @@ -63,6 +63,9 @@ class SongRequest(Timestampable, models.Model): objects = models.Manager() music = RequestManager() + class Meta: + ordering = ['-created_date', ] + def __str__(self): req_user = self.profile.user.get_username() return "{} - Requested by {} at {}".format(self.song.title,