Skip to content

Commit

Permalink
added ordering meta class to models
Browse files Browse the repository at this point in the history
  • Loading branch information
LTDakin committed Mar 4, 2024
1 parent ce22979 commit 3d3689b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions datalab/datalab_session/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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'
Expand Down

0 comments on commit 3d3689b

Please sign in to comment.