Thank Bruno, but both shows some errors. *1st one*
Traceback (most recent call last): File "C:\web2py\gluon\restricted.py", line 205, in restricted exec ccode in environment File "C:\web2py\applications\home\views\default/index.html", line 64, in <module> File "C:\web2py\gluon\globals.py", line 182, in write self.body.write(xmlescape(data)) File "C:\web2py\gluon\html.py", line 114, in xmlescape return data.xml() File "C:\web2py\gluon\html.py", line 2146, in xml return self.serialize(self.data, 0).xml() File "C:\web2py\gluon\html.py", line 2121, in serialize li.append(self.serialize(item[3], level+1)) File "C:\web2py\gluon\html.py", line 2109, in serialize (name, active, link) = item[:3] TypeError: 'NoneType' object is not subscriptable *2nd one* * * Traceback (most recent call last): File "C:\web2py\gluon\restricted.py", line 205, in restricted exec ccode in environment File "C:/web2py/applications/home/models/menu.py", line 33, in <module> response.menu[1][3] += [('Admin', False, URL('admin'))] TypeError: 'tuple' object does not support item assignment On Wednesday, April 11, 2012 11:36:33 AM UTC-5, rochacbruno wrote: > > response.menu = [('Home', False, URL('home','default','index'), []), > (SPAN('Price List',_style='color:yellow'), True, > URL('pricelist','default','index'), > [('Guideline', False, URL('pricelist','default','guideline')), > ('Multiplier Tables', False, > URL('pricelist','default','multitable')), > ('Cut Charge Tables', False, URL('pricelist','default','cuttable')), > * ('Admin', False, URL('admin')) if (auth.user_id != None) and > ((auth.has_membership(role = 'admin'))) else None* > ])] > > > or > > if (auth.user_id != None) and ((auth.has_membership(role = 'admin'))): > response.menu[1][3] += [('Admin', False, URL('admin')), ] > > > On Wed, Apr 11, 2012 at 1:24 PM, Omi Chiba <ochib...@gmail.com> wrote: > >> response.menu = [('Home', False, URL('home','default','index'), []), >> (SPAN('Price List',_style='color:yellow'), True, >> URL('pricelist','default','index'), >> [('Guideline', False, URL('pricelist','default','guideline')), >> ('Multiplier Tables', False, >> URL('pricelist','default','multitable')), >> ('Cut Charge Tables', False, >> URL('pricelist','default','cuttable')), >> ])] >> > > > > -- > > Bruno Rocha > [http://rochacbruno.com.br] > >