diff options
author | luxagraf@c63593aa-01b0-44d9-8516-4b9c7e931d7f <luxagraf@c63593aa-01b0-44d9-8516-4b9c7e931d7f> | 2010-05-09 02:32:42 +0000 |
---|---|---|
committer | luxagraf@c63593aa-01b0-44d9-8516-4b9c7e931d7f <luxagraf@c63593aa-01b0-44d9-8516-4b9c7e931d7f> | 2010-05-09 02:32:42 +0000 |
commit | e01eed46a5a017dd1bc82a1e80de37d9a69ab12c (patch) | |
tree | 5dbbf6cc0581951d835d59dee5d2b062ebc81197 /apps/projects/views.py | |
parent | 3085c5781346993f09882936151bb70e212df420 (diff) |
revamped national parks project files
Diffstat (limited to 'apps/projects/views.py')
-rw-r--r-- | apps/projects/views.py | 14 |
1 files changed, 13 insertions, 1 deletions
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 |