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={