From 4069924a6c994e5c43dc61de75d3637e843676ca Mon Sep 17 00:00:00 2001 From: Trey t Date: Tue, 18 Jul 2023 09:43:53 -0500 Subject: [PATCH] WIP --- superset/admin.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/superset/admin.py b/superset/admin.py index 5301cae..f20f2b3 100644 --- a/superset/admin.py +++ b/superset/admin.py @@ -15,8 +15,13 @@ class SupersetExerciseInline(admin.StackedInline): @admin.register(Superset) class SupersetAdmin(ImportExportModelAdmin): - list_display = ("name", "workout", "order", "rounds",) + list_display = ("name", "workout", "order", "rounds", "get_workout_id",) ordering = ("order",) inlines = [ SupersetExerciseInline, - ] \ No newline at end of file + ] + + def get_workout_id(self, obj): + return obj.workout.id + get_workout_id.admin_order_field = 'workout_id' #Allows column order sorting + get_workout_id.short_description = 'Workout id' #Renames column head \ No newline at end of file