On Wednesday, January 25, 2012 9:23:51 AM UTC-5, Web2Py Freak wrote:
>
> it keep giving me en error in the response.menu failed to compile file
> because:
> SyntaxError at line 30 at char 7
> invalid syntax (C:/web2py/applications/a3zif/models/menu.py, line
> 30) , this is my code :
>
>
> instruments = db().select(db.Instruments.ALL)
> myins = []
> for ins in instruments:
> myins.append((T(ins.Instrument_name), False,
> URL('default','Instruments',args=ins.Instrument_name),)
>
Looks like you're missing the closing ")" at the end of your tuple above --
should be:
myins.append((T(ins.Instrument_name), False,
URL('default','Instruments',args=ins.Instrument_name)))
Also, maybe try a list comprehension instead of the loop:
myins = [(T(ins.Instrument_name), False, URL('default',
'Instruments', args=ins.Instrument_name))
for ins in instruments]
Anthony