ピラミッド初心者です。私はpython2.7、MSSQL、slqalchemy.mssqlを使用し、文字セットを使用しgbk
ており、古いデータがたくさんあります。そこでgbk
、次のコードを使用して、フロント html を にエンコードするように変更します。
@view_config(route_name='g', renderer='json')
def my_view1(request):
print 2
print request.charset
print 1
print isinstance(request.params['one'], str)
if request.params['one']:
print request.params['one']
filters = (Bzjl.one == request.params['one'])
try:
two1 = DBSession.query(Bzjl).filter(filters)
except DBAPIError:
return Response(conn_err_msg, content_type='text/plain', status_int=500)
return Response(getjson(two1))
URL の例:http://127.0.0.1:6543/g?one='中国福建'
行を返しません:{"records": 0, "total": 20, "rows": [], "page": 1}