From e01eed46a5a017dd1bc82a1e80de37d9a69ab12c Mon Sep 17 00:00:00 2001 From: "luxagraf@c63593aa-01b0-44d9-8516-4b9c7e931d7f" Date: Sun, 9 May 2010 02:32:42 +0000 Subject: revamped national parks project files --- apps/projects/views.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'apps/projects/views.py') diff --git a/apps/projects/views.py b/apps/projects/views.py index e3ed773..65de8ae 100644 --- a/apps/projects/views.py +++ b/apps/projects/views.py @@ -2,8 +2,10 @@ 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 @@ -24,3 +26,13 @@ def detail(request,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 -- cgit v1.2.3-70-g09d2