Esempio n. 1
0
 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
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 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. 4
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. 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, 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)
Esempio n. 7
0
 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)
Esempio n. 8
0
    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