I only went and figured it out....strings!

response.ttt = 
db((db.page.showinmenu==1)&(db.page.active==1)).select(db.page.id, 
db.page.menutext, db.page.pageurl, db.page.parent, 
orderby=db.page.parent|db.page.sort|db.page.menutext)
response.tttmenu = [[],dict()]
for subpage in response.ttt:
    response.tttmenu[0].append({str(subpage.id): [subpage.menutext, 
subpage.pageurl, subpage.parent]})
    if str(subpage.parent) in response.tttmenu[1]:
        response.tttmenu[1][str(subpage.parent)].append(subpage.id)
    else:
        response.tttmenu[1][str(subpage.parent)] = [subpage.id]

def buildmenu(parent, menu):
    html = ''
    if menu[1][str(parent)]:
        html += '<ul>'
        for itemid in menu[1][str(parent)]:
            if str(itemid) in menu[1]:
                #children
                html += '<li>'+str(itemid)
                html += buildmenu(itemid, menu)
                html += '</li>'
            else:
                #no children
                html += '<li>'+str(itemid)+'</li>'
    html += '</ul>'
    return html

response.tttnewmenu = buildmenu(0, response.tttmenu)

this renders it exactly as needed to build the menu - just need to alter 
the html to encase into array syntax needed for MENU()

thank you everyone for you assistance.

Reply via email to