Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class LandDocument(DocType):
- city = fields.StringField()
- latitude = fields.FloatField()
- longitude = fields.FloatField()
- location = fields.GeoPoint()
- def find_near_by(self, distance=5000):
- return self.search().filter(
- 'geo_distance', distance=f'{distance}m', location={
- 'lat': self.latitude,
- 'lon': self.longitude
- }
- )
Add Comment
Please, Sign In to add comment