Esempio n. 1
0
 def get(self):
     rows = db.Query(Row)
     text = []
     for row in rows:
         text.append('%s %s' % (row.key(), row.owner))
         for marker in Marker.all().filter("row =", row):
             text.append(' - %s %s' % (marker.time, marker.value))
     text.append(str(self.request.environ))
     text = '\n'.join(text)
     self.response.out.write(template.render('templates/pre.html', {
         'text': text}))
Esempio n. 2
0
def xml(map_id):
    if re.search('^\d+$', map_id):
        maps = Map.all().filter("id = ", int(map_id)).fetch(1)
    else:
        map_id_list = [int(x) for x in map_id.split(',')]
        maps = Map.all().filter("id IN", map_id_list).fetch(1000)

    for map in maps:
        map.polylines = Polyline.all().filter("map =", map).fetch(1000)
        map.markers = Marker.all().filter("map =", map).fetch(1000)

    xml = render_template('map.xml', maps=maps)

    resp = app.make_response(xml)
    resp.headers['Content-Type'] = 'application/xml; charset=UTF-8'
    return resp