diff options
Diffstat (limited to 'apps/projects/views.py')
-rw-r--r-- | apps/projects/views.py | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/apps/projects/views.py b/apps/projects/views.py deleted file mode 100644 index 64857a7..0000000 --- a/apps/projects/views.py +++ /dev/null @@ -1,38 +0,0 @@ -from django.shortcuts import render_to_response,get_object_or_404 -from django.template import RequestContext -from django.views.generic.list_detail import object_list -from django.db.models import get_model -from django.http import HttpResponse -from django.core import serializers - -from projects.shortcuts import render_to_geojson -from projects.models.base import Project -from projects.models.fiveby import FiveBy -from projects.models.natparks import NationalParks - -projects = {'5x5':'FiveBy','6x6':'SixBy','national-parks':'NationalParks','code':'Code'} - -""" -Projects by slug -""" -def detail(request,slug): - name = projects[slug] - model = get_model('projects', name) - 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,) - - -def data_json(request, id): - qs = NationalParks.objects.filter(pk=id) - return render_to_geojson( - qs, - included_fields=['id',], - geom_attribute='mpoly', - mimetype = 'application/json', - pretty_print=True - ) -
\ No newline at end of file |