From 46806df781a8e23bd75e916005aaba49ef009adb Mon Sep 17 00:00:00 2001 From: luxagraf Date: Sun, 8 Mar 2020 11:46:14 -0400 Subject: added and organized walk admin list view --- app/locations/admin.py | 2 +- app/locations/models.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'app/locations') diff --git a/app/locations/admin.py b/app/locations/admin.py index 4beca5b..df65894 100644 --- a/app/locations/admin.py +++ b/app/locations/admin.py @@ -292,7 +292,7 @@ class GPXTrackAdmin(OLAdminBase): @admin.register(Walk) class WalkAdmin(OLAdminBase): form = LGEntryForm - list_display = ('title', 'date_walked', 'rating', 'location') + list_display = ('title', 'date_walked', 'distance', 'rating', 'location') list_filter = ('rating', 'location', 'date_walked') prepopulated_fields = {'slug': ('title',)} search_fields = ('tite',) diff --git a/app/locations/models.py b/app/locations/models.py index bab2c15..e0409eb 100644 --- a/app/locations/models.py +++ b/app/locations/models.py @@ -488,6 +488,9 @@ class Walk(models.Model): def __str_(self): return self.title + class Meta: + ordering = ('-date_walked',) + def get_rating(self): return int(self.rating) -- cgit v1.2.3-70-g09d2