예제 #1
0
def get_near_rsts(zoom, lat, lng, limit, lonely):
    '''(lat, lng)に近い店舗をzoomにあわせてlimit件取得する
    '''
    limit = limit if limit else 100
    rsts = df.near_rests(lat=lat, lng=lng, zoom=zoom, limit=limit, lonely=lonely)
    # rsts = [rst._asdict() for rst in rsts] if rsts else None
    return rsts if rsts else None
예제 #2
0
def index():
    # ユーザ一覧からレスポンスを作る
    response = jsonify({'name': request.args.get('name')})
    index_info = df.near_rests(zoom=10)
    index_count, index_data = _to_serializable_dict(index_info)
    response = jsonify({'count': index_count, 'result' : index_data})
    # ステータスコードは OK (200)
    # response.status_code = 200
    return response