I am generating static files on the fly but cannot get the URL function to work:
NB: here filename
is a key-value returned by the controller
{{=P(A('Download ', filename,_href=URL('static', filename)))}}
generates an error:
type 'exceptions.SyntaxError'> when calling URL, function or function name required
However if I replace the filename variable with a string (as follows) the link is generated OK
{{=P(A('Download ', filename,_href=URL('static', 'abcis_data_42Data_.NO2.__.zip')))}}
Any ideas?
OK solved. filename is of type unicode and using str(filename) solves the problem.