summaryrefslogtreecommitdiff
path: root/apps/projects/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'apps/projects/views.py')
-rw-r--r--apps/projects/views.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/apps/projects/views.py b/apps/projects/views.py
index 8103270..e3ed773 100644
--- a/apps/projects/views.py
+++ b/apps/projects/views.py
@@ -6,8 +6,9 @@ from django.db.models import get_model
from projects.models.base import Project
from projects.models.fiveby import FiveBy
+from projects.models.natparks import NationalParks
-projects = {'5x5':'FiveBy','6x6':'SixBy'}
+projects = {'5x5':'FiveBy','6x6':'SixBy','national-parks':'NationalParks'}
"""
Projects by slug
@@ -15,7 +16,10 @@ Projects by slug
def detail(request,slug):
name = projects[slug]
model = get_model('projects', name)
- qs = model.objects.filter(status__exact=1)
+ if slug == 'national-parks':
+ qs = model.objects.filter(visited__exact=True).order_by("-date_visited_begin")
+ else:
+ qs = model.objects.filter(status__exact=1)
template = 'details/%s.html' %(slug)
return object_list(request, queryset=qs, template_name=template,)