Update index filter

This commit is contained in:
Andros Fenollosa 2018-04-05 09:22:34 +02:00
parent 71d8c9e08e
commit 3361d70e0a

3
app.py
View File

@ -29,7 +29,8 @@ CORS(app, resources={r"/api/*": {"origins": "*"}})
@app.route(PRE_URL + 'index/<int:id>') @app.route(PRE_URL + 'index/<int:id>')
def index(id): def index(id):
match = POSTALS.loc[[id]] match = POSTALS.loc[[id]]
return match.reset_index().to_json(orient='records') results = match.filter(items=['postal_code', 'poblacion', 'lat', 'lng'])
return results.reset_index().to_json(orient='records')
# Get data from postal code # Get data from postal code