From 3d3689bf3787f402288e1cf6188ed5d62fd39b93 Mon Sep 17 00:00:00 2001 From: Lloyd Dakin Date: Mon, 4 Mar 2024 14:29:57 -0800 Subject: [PATCH] added ordering meta class to models --- datalab/datalab_session/models.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/datalab/datalab_session/models.py b/datalab/datalab_session/models.py index 6d97669..f94720c 100644 --- a/datalab/datalab_session/models.py +++ b/datalab/datalab_session/models.py @@ -5,6 +5,9 @@ class DataSession(models.Model): + class Meta: + ordering = ['-modified'] + user = models.ForeignKey( User, on_delete=models.CASCADE, help_text='The user that this DataSession belongs too' @@ -43,6 +46,9 @@ def from_db(cls, db, field_names, values): class DataOperation(models.Model): + class Meta: + ordering = ['pk'] + session = models.ForeignKey( DataSession, related_name='operations', on_delete=models.CASCADE, help_text='The DataSession to which this DataOperation belongs'