From b845cc054a28dbc4388fa83fad7521af1b31b13d Mon Sep 17 00:00:00 2001 From: reverend Date: Thu, 24 Dec 2020 19:25:37 +0100 Subject: [PATCH] Small Tweaks --- django_lostplaces/lostplaces/models/models.py | 2 +- django_lostplaces/lostplaces/views/explorer_views.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/django_lostplaces/lostplaces/models/models.py b/django_lostplaces/lostplaces/models/models.py index 8c87ae1..0146c50 100644 --- a/django_lostplaces/lostplaces/models/models.py +++ b/django_lostplaces/lostplaces/models/models.py @@ -30,7 +30,7 @@ class Explorer(models.Model): favorite_places = models.ManyToManyField( Place, - related_name='favorite_places', + related_name='explorer_favorites', verbose_name='Explorers favorite places', blank=True ) diff --git a/django_lostplaces/lostplaces/views/explorer_views.py b/django_lostplaces/lostplaces/views/explorer_views.py index 3fee7d3..d96ad45 100644 --- a/django_lostplaces/lostplaces/views/explorer_views.py +++ b/django_lostplaces/lostplaces/views/explorer_views.py @@ -16,7 +16,7 @@ from lostplaces.models.place import Place, PlaceAsset class ExplorerProfileView(IsAuthenticatedMixin, View): def get(self, request, explorer_id): explorer = get_object_or_404(Explorer, pk=explorer_id) - place_list = Place.objects.filter(submitted_by=explorer) + place_list = explorer.places.all() place_count = place_list.count() context={