def get(self): mills=Mill.proximity_fetch(Mill.all(), db.GeoPt(38.968780,-77.293140), max_results=20 ) photos=photos=Photo.all().filter('status =', 'approved').order('-added') return self.render_response('map/index.html', mills=mills, photos=photos)
def get(self): mills = Mill.proximity_fetch(Mill.all(), db.GeoPt(38.968780, -77.293140), max_results=20) photos = photos = Photo.all().filter('status =', 'approved').order('-added') return self.render_response('map/index.html', mills=mills, photos=photos)
def post(self): layer = self.request.form['layer'] kml_id = self.request.form['kml_id'] br = blobstore.BlobReader(kml_id) kml = extract_kml(br) et = ElementTree(file=kml) root = et.getroot() kml_namespace = root.tag[1:].split('}')[0] folder_tag = "{%s}Folder" % kml_namespace name_tag = "{%s}name" % kml_namespace placemark_tag = "{%s}Placemark" % kml_namespace for document in list(root): for folder in document.findall(folder_tag): if folder.attrib['id'] != layer: continue mills = folder.findall(placemark_tag) for mill in mills: Mill.from_placemark(mill) return ("OK")
def post(self): layer=self.request.form['layer'] kml_id=self.request.form['kml_id'] br=blobstore.BlobReader(kml_id) kml=extract_kml(br) et = ElementTree(file=kml) root=et.getroot() kml_namespace=root.tag[1:].split('}')[0] folder_tag="{%s}Folder" % kml_namespace name_tag="{%s}name" % kml_namespace placemark_tag="{%s}Placemark" % kml_namespace for document in list(root): for folder in document.findall(folder_tag): if folder.attrib['id'] != layer: continue mills=folder.findall(placemark_tag) for mill in mills: Mill.from_placemark(mill) return("OK")
def get(self): upload_url = blobstore.create_upload_url( self.url_for('admin/uploadkml')) #upload_url = self.url_for('admin/uploadkml') mills = Mill.all().fetch(1000) photos = Photo.all().filter('status =', 'submitted') return self.render_response('admin.html', upload_kml_form=self.upload_kml_form, upload_url=upload_url, pending_photos=photos, mills=mills)
def get(self): upload_url = blobstore.create_upload_url(self.url_for('admin/uploadkml')) #upload_url = self.url_for('admin/uploadkml') mills= Mill.all().fetch(1000) photos=Photo.all().filter('status =', 'submitted') return self.render_response('admin.html', upload_kml_form=self.upload_kml_form, upload_url=upload_url, pending_photos=photos, mills=mills )
def post(self): logging.info(str(self.request.form)) mill = Mill( key_name=self.request.form['MILL_NO'], name=self.request.form['MILL_NAME'], location=db.GeoPt(float(self.request.form['Lat']), float(self.request.form['Long'])), ) mill.mill_no = int(self.request.form['MILL_NO']) mill.year = self.request.form['YEAR'] mill.update_location() mill.put() return Response()
def post(self): logging.info(str(self.request.form)) mill = Mill( key_name=self.request.form["MILL_NO"], name=self.request.form["MILL_NAME"], location=db.GeoPt(float(self.request.form["Lat"]), float(self.request.form["Long"])), ) mill.mill_no = int(self.request.form["MILL_NO"]) mill.year = self.request.form["YEAR"] mill.update_location() mill.put() return Response()