Esempio n. 1
0
    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)
Esempio n. 2
0
 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)
Esempio n. 3
0
    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")
Esempio n. 4
0
 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")
Esempio n. 5
0
    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)
Esempio n. 6
0
    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
    	    )
Esempio n. 7
0
    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()
Esempio n. 8
0
    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()