def post(self, mill_no, slug): blob=self.get_uploads('photo')[0] mill=Mill.get_by_key_name(mill_no) photo=Photo(image=blob,mill=mill,location=mill.location, name=self.request.form['myname']) photo.update_location() photo.put() response= self.redirect(self.url_for('photo-upload-thanks'), 302) response.data = '' return response
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 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 get(self, mill_no, slug): mill=Mill.get_by_key_name(mill_no) nearby=[] try: nearby=Mill.proximity_fetch(Mill.all(), mill.location, max_results=6 ) except: pass photos=Photo.all().filter('mill =', mill).filter('status =', 'approved') return self.render_response('mills/single.html', mill=mill, nearby=nearby[1:],photos=photos)
def get(self, mill_no, slug): mill = Mill.get_by_key_name(mill_no) nearby = [] try: nearby = Mill.proximity_fetch(Mill.all(), mill.location, max_results=6) except: pass photos = Photo.all().filter('mill =', mill).filter('status =', 'approved') return self.render_response('mills/single.html', mill=mill, nearby=nearby[1:], photos=photos)
def post(self, mill_no, slug): blob = self.get_uploads('photo')[0] mill = Mill.get_by_key_name(mill_no) photo = Photo(image=blob, mill=mill, location=mill.location, name=self.request.form['myname']) photo.update_location() photo.put() response = self.redirect(self.url_for('photo-upload-thanks'), 302) response.data = '' return response