Hi Johan,
following code works for me to insert some items from the db into a submenu:
response.menu = [
('Home', False, URL('default','index'), []),
]
if auth.is_logged_in():
locaties = db(db.locatie.apotheek_id==auth.user.apotheek_id).select()
if locaties:
locaties_lijst = []
for locatie in locaties:
locaties_lijst.append( (locatie.naam, False,
URL(c='rapporten',f='boekingsverslag',args=locatie.id),[]) )
locaties_lijst.append( ('Compleet', False,
URL(c='rapporten',f='boekingsverslag_compleet'),[]) )
response.menu += (( ('Rapporten', False, URL(),[
('Saldo\'s', False,
URL('rapporten','saldos'),[]),
('Boekingsverslag', False, URL(),
locaties_lijst)
]),
('Beheer', URL(), False,[
('geld locaties', False, URL(), [
('overzicht', False,
URL('beheer','locaties_overzicht')),
('toevoegen', False,
URL('beheer','locatie_toevoegen'))])
])
))
--