I'm working on a widget-like .represent function for my RESTful
controller design:

# Designed to be called via table.represent to make t2.itemize()
output useful
# - display nice names with clickable links & optional extra info
def shn_list_item(table,action,display='table.name',extra=None):
    if extra:
        items=DIV(TR(TD(A(eval(display),_href=t2.action
(table._tablename,[action,table.id]))),TD(eval(extra))))
    else:
        items=DIV(A(eval(display),_href=t2.action(table._tablename,
[action,table.id])))
    return DIV(*items)

However this doesn't work since 'table' here actually isn't a table at
all, but a record (SQLROWS type?) & so the ._tablename attribute isn't
defined.

Is there an equivalent or what patch would be needed to support this?

Many thanks,
Fran.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to