Ejemplo n.º 1
0
 def get(self):
     points=[]
 	mills=Mill.all()
 	for mill in mills:
 	    p=geojson.Point([mill.location.lat,mill.location.lon], properties={'name':mill.name, 'link':self.url_for('mills/single', mill_no=mill.mill_no, slug=mill.slug)})
 	    points.append(p)
 	
 	return Response(geojson.dumps(geojson.FeatureCollection(features=points)))
 	
 	return self.render_response('mills/markers.js', mills=mills)
Ejemplo n.º 2
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)
Ejemplo n.º 3
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)
Ejemplo n.º 4
0
    def get(self):
        points = []
        mills = Mill.all()
        for mill in mills:
            p = geojson.Point(
                [mill.location.lat, mill.location.lon],
                properties={
                    'name':
                    mill.name,
                    'link':
                    self.url_for('mills/single',
                                 mill_no=mill.mill_no,
                                 slug=mill.slug)
                })
            points.append(p)

        return Response(
            geojson.dumps(geojson.FeatureCollection(features=points)))

        return self.render_response('mills/markers.js', mills=mills)