Skip to content

Commit

Permalink
Merge pull request #4 from LCOGT/feature/order-sessions-operations
Browse files Browse the repository at this point in the history
added ordering meta class to models
  • Loading branch information
LTDakin authored Mar 4, 2024
2 parents ce22979 + 3d3689b commit 5b0fd9d
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 5b0fd9d

Please sign in to comment.