Python 2.7 Python 2.7+Flask TypeError:“unicode”对象不可调用

Python 2.7 Python 2.7+Flask TypeError:“unicode”对象不可调用,python-2.7,unicode,encoding,flask,python-unicode,Python 2.7,Unicode,Encoding,Flask,Python Unicode,我正在尝试连接2个unicode字符串,但出现错误 代码: 在语句sql=text….之前定义text=u。。。。因此,例外情况是“unicode”对象不可调用 @app.route('/', methods = ['GET','POST']) def index(): form = forms.MyForm() rtv = [] text = u'' if request.method == 'POST': lat = form.latitude

我正在尝试连接2个unicode字符串,但出现错误

代码:

在语句sql=text….之前定义text=u。。。。因此,例外情况是“unicode”对象不可调用

@app.route('/', methods = ['GET','POST'])
def index():
    form = forms.MyForm()
    rtv = []
    text = u''
    if request.method == 'POST':
        lat = form.latitude.data
        lng = form.longitude.data
        rds = form.radio.data
        sql = text("select place, tweet_id, tweet_text from tweets where ST_DistanceSphere(geom, ST_MakePoint(" + lng + ","+ lat +")) <= "+ rds +" * 1609.344 * 0.62137;")
        result = db.engine.execute(sql)
        for row in result:
            text = text+row[2] #row[2] is a unicode string
            rtv.append([row[0],row[1],row[2]])
        print text
    return render_template('base.html', form = form, rtv = rtv, text = text)