From 6d68c59ac3655a941007434a172c22be240b7618 Mon Sep 17 00:00:00 2001 From: Trey t Date: Wed, 26 Jul 2023 17:21:24 -0500 Subject: [PATCH] WIP --- workout/admin.py | 4 +++- workout/models.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/workout/admin.py b/workout/admin.py index ee0fd8a..32ae856 100644 --- a/workout/admin.py +++ b/workout/admin.py @@ -32,4 +32,6 @@ class CompletedWorkoutAdmin(admin.ModelAdmin): @admin.register(PlannedWorkout) class PlannedWorkoutAdmin(admin.ModelAdmin): - list_display = ("registered_user", "workout", "on_date",) \ No newline at end of file + list_display = ("registered_user", "workout", "on_date",) + + ordering = ['workout__created_at'] \ No newline at end of file diff --git a/workout/models.py b/workout/models.py index cec54b7..a70d714 100644 --- a/workout/models.py +++ b/workout/models.py @@ -23,7 +23,7 @@ class Workout(models.Model): estimated_time = models.FloatField(max_length=255, blank=True, null=True) def __str__(self): - return self.name #+ " : " + self.description + " | by: " + self.registered_user.nick_name + return self.name + " : " + self.description + " | by: " + str(self.created_at) class WorkoutExercise(models.Model): created_at = models.DateTimeField(auto_now_add=True)