thats not a bug, thats the behavior of template system. You can have
comments only as first character on a line.
allowed
{{#comment}}
disallowed
{{=foo # this will print foo }}
as far as I remember, if I am not wrong... this has a good purpose and it
is related of the literal '#' character.
you can try using two hashes, but I am not sure. (I am on mobile and I cant
test now)
{{="foo" ##this prints foo}}
http://zerp.ly/rochacbruno
Em 08/03/2012 06:53, "weheh" <[email protected]> escreveu:
> this works when placed inside a view:
>
> {{
> def myfunc(rows):
> text=[]
> for x in rows:
> text.append(...stuff...)
> pass
> pass
> }}
>
> this gets ticketed when inside a view:
> {{
> def myfunc(rows):
> text=[]
> for x in rows: # AN INNOCENT COMMENT THAT CAUSES TICKET
> text.append(...stuff...)
> pass
> pass
> }}
>
> Traceback (most recent call last):
> File "N:\web2py\gluon\restricted.py", line 203, in restricted
> ccode = compile2(code,layer)
> File "N:\web2py\gluon\restricted.py", line 189, in compile2
> return compile(code.rstrip().replace('\r\n','\n')+'\n', layer,
> 'exec')
> File "N:\web2py\applications\myapp\views\myview/index.load", line 54
> text.append(
> ^
> IndentationError: expected an indented block
>