数据库有个中文字段名叫'名称',如何根据这个中文字段做搜索 。
result=Minicomputer.query.filter_by(u'名称'='CC670a').first()
报错如下
Traceback (most recent call last):
File "manage.py", line 15, in <module>
app = create_app(os.getenv('FLASK_CONFIG') or 'default')
File "/mnt/hgfs/python/flask/Project/__init__.py", line 34, in create_app
from .main import main as main_blueprint
File "/mnt/hgfs/python/flask/Project/main/__init__.py", line 3, in <module>
from . import views, errors
File "/mnt/hgfs/python/flask/Project/main/views.py", line 95
result=Minicomputer.query.filter_by(u'名称'='CC670a').first()
SyntaxError: keyword can't be an expression
做一个表名的映射即可