-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfind_places.py
More file actions
38 lines (27 loc) · 944 Bytes
/
find_places.py
File metadata and controls
38 lines (27 loc) · 944 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import requests
from flask import Flask, Blueprint, render_template, session, redirect, request
from models import User, db, Place
find_places = Blueprint("find_places", __name__, static_folder="static", template_folder="templates")
@find_places.route('/')
def find_page_view():
if 'email' in session:
return render_template('newtest.html')
else:
return redirect('/')
@find_places.route('/cities/')
def find_city_view():
if 'email' in session:
return render_template('citytest.html')
else:
return redirect('/')
# @find_places.route('/local')
# def find_places():
# data = request.json
# lat = data.get('lat')
# lon = data.get('lon')
# radius = data.get('radius')
# places = Place.query.filter_by().all()
# places_result = []
# for place in places:
# if place.calculate_distance(lat=lat, lon=lon) <= radius:
# places_result.insert(place)