That should never have worked, as it is not a legal Python identifier. 
However, you can do:

A('move out', _href=URL('#myModal'), **{'_data-toggle': 'modal'})

This is actually discussed in the book, at the end of this section: 
http://web2py.com/books/default/chapter/29/5#HTML-helpers.

Anthony

On Tuesday, June 26, 2012 6:46:08 PM UTC-4, pbreit wrote:
>
> I'm getting an error on:
> {{=A('move out', _href=URL('#myModal'), _data-toggle='modal')}}
>
> Traceback (most recent call last):
>   File "/Users/pbreit/web2py/gluon/restricted.py", line 204, in restricted
>     ccode = compile2(code,layer)
>   File "/Users/pbreit/web2py/gluon/restricted.py", line 189, in compile2
>     return compile(code.rstrip().replace('\r\n','\n')+'\n', layer, 'exec')
>   File 
> "/Users/pbreit/web2py/applications/rentmatic/views/default/property.html", 
> line 115
>     
> SyntaxError: keyword can't be an expression
>
> The problem is with the dash in the '_data-toggle' attribute.
>
>
>
> This works OK but of course I need it to be '_data-toggle'.
> {{=A('move out', _href=URL('#myModal'), _data='modal')}}
>
>
>
> The error is different when there is just a dash at the end:
> {{=A('move out', _href=URL('#myModal'), _data-='modal')}}
>
> Traceback (most recent call last):
>   File "/Users/pbreit/web2py/gluon/restricted.py", line 204, in restricted
>     ccode = compile2(code,layer)
>   File "/Users/pbreit/web2py/gluon/restricted.py", line 189, in compile2
>     return compile(code.rstrip().replace('\r\n','\n')+'\n', layer, 'exec')
>   File 
> "/Users/pbreit/web2py/applications/rentmatic/views/default/property.html", 
> line 115
>     response.write(A('move out', _href=URL('#myModal'), _data-='modal'))
>                                                               ^
> SyntaxError: invalid syntax
>
>
> I'm pretty sure this used to work.
>

-- 



Reply via email to