it's just a list like any other. So use append and so forth. http://docs.python.org/2/tutorial/introduction.html#lists Should help. Notice in the example app he also used + to append items. BR, Jason
On Wed, Jul 10, 2013 at 10:55 AM, lucas <sjluk...@gmail.com> wrote: > how can i insert into response.menu? like: > > response.menu.insert(0,MENU([(T('Admin'), False, '', [])])) > > i can't seem to dynamically insert or append into menu and i am not sure > why. i get the exception throwback: > > Traceback (most recent call last): > File "/opt/web-apps/web2py/gluon/restricted.py", line 212, in restricted > exec ccode in environment > File > "/opt/web-apps/web2py/applications/accuratesupport/views/default/onlogin.html", > line 70, in <module> > File "/opt/web-apps/web2py/gluon/globals.py", line 203, in write > self.body.write(xmlescape(data)) > File "/opt/web-apps/web2py/gluon/html.py", line 120, in xmlescape > return data.xml() > File "/opt/web-apps/web2py/gluon/html.py", line 2453, in xml > return self.serialize(self.data, 0).xml() > File "/opt/web-apps/web2py/gluon/html.py", line 2406, in serialize > (name, active, link) = item[:3] > ValueError: need more than 1 value to unpack > > > -- > > --- > You received this message because you are subscribed to the Google Groups > "web2py-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to web2py+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.