Seems to be related to this issue, https://groups.google.com/g/py4web/c/-V7fYJL7S44
Using the "search_queries" option, searches containing special characters such as ñ or accented letters used in Spanish do not work.
When pressing the search button strange characters appear and each time the button is pressed more and more characters appear.
A code example:
db.define_table(
't_test_grid',
Field('f_test1', 'string', length=30),
)
db.commit()
if not db(db.t_test_grid).select():
db.t_test_grid.insert(f_test1='niña')
db.t_test_grid.insert(f_test1='niño')
db.t_test_grid.insert(f_test1='camión')
db.t_test_grid.insert(f_test1='cigüeña')
db.commit()
@action('grid_test')
@action('grid_test/<path:path>')
@action.uses('grid_test.html', db)
def grid_test(path=None):
t_test_grid = db.t_test_grid
grid = Grid(
path=path,
query=t_test_grid,
search_queries=[
('Test', lambda value: t_test_grid.f_test1.contains(value)),
],
rows_per_page=10,
)
return dict(grid=grid)
Another similar problem this time with the response header.
Looks like it’s coming from ombott/response.py line 159
Small simplified example:
@authenticated('download_document', method=['GET'])
def download_document():
document_pdf = get_document()
response.headers['Content-Type'] = 'application/pdf'
response.headers['Content-Disposition'] = f'attachment; filename=información.pdf'
return document_pdf
The file is downloaded with this name, información.pdf