diff options
author | luxagraf <sng@luxagraf.net> | 2020-03-08 11:46:14 -0400 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2020-03-08 11:46:14 -0400 |
commit | 46806df781a8e23bd75e916005aaba49ef009adb (patch) | |
tree | a79e490c393a6b91a7187147062308149fac68b2 /app/locations | |
parent | 40939853e11766abbd2976c076af3f1d72f6d206 (diff) |
added and organized walk admin list view
Diffstat (limited to 'app/locations')
-rw-r--r-- | app/locations/admin.py | 2 | ||||
-rw-r--r-- | app/locations/models.py | 3 |
2 files changed, 4 insertions, 1 deletions
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) |