Package madrona :: Package layer_manager :: Module views
[hide private]

Source Code for Module madrona.layer_manager.views

 1  from django.http import HttpResponse 
 2  from django.utils import simplejson 
 3  from django.shortcuts import render_to_response 
 4  from django.template import RequestContext 
 5  from django.views.decorators.cache import cache_page, cache_control 
 6  from models import * 
7 8 @cache_page(60 * 60 * 8) 9 @cache_control(must_revalidate=False, max_age=60 * 60 * 8) 10 -def get_json(request):
11 json = { 12 "state": { 13 "activeLayers": [] 14 }, 15 "layers": [layer.toDict for layer in Layer.objects.filter(is_sublayer=False)], 16 "themes": [theme.toDict for theme in Theme.objects.all()], 17 "success": True 18 } 19 return HttpResponse(simplejson.dumps(json))
20
21 -def demo(request):
22 context = RequestContext(request) 23 return render_to_response('layer_manager/demo.html', context)
24