Nicely done!

On Mon, Apr 11, 2011 at 7:24 PM, Niklas Rosencrantz <[email protected]> wrote:
> Thanks for the help. The response is now working and is not timing out with
> code responding via www.koolbusiness.com/list.kml with backend:
>
>  def get(self):
>     self.response.headers["Cache-Control"] = "public,max-age=%s" % 86400
>     start=datetime.datetime.now()-timedelta(days=60)
>     count = int(self.request.get('count')) if not
> self.request.get('count')=='' else 1000
>     from google.appengine.api import memcache
>     memcache_key = "ads"
>     data = memcache.get(memcache_key)
>     if data is None:
>       a= Ad.all().filter("modified >", start).filter("url IN",
> ['www.koolbusiness.com']).filter("published =",
> True).order("-modified").fetch(count)
>       memcache.set("ads", a)
>     else:
>       a = data
>     dispatch='templates/kml.html'
>     template_values = {'a': a , 'request':self.request, 'host':host}
>     path = os.path.join(os.path.dirname(__file__), dispatch)
>     output = template.render(path, template_values)
>     self.response.headers['Content-Type'] =
> 'application/vnd.google-earth.kml+xml'
>     self.response.headers['Content-Length'] = len(output)
>     self.response.out.write(output)
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Maps JavaScript API v3" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/google-maps-js-api-v3?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Reply via email to