@auth.need_login
@webhelpers.setup_dbsession
def view(request, tablename=None, rowid=None):
    klass = get_model(tablename)
    dbrow = webhelpers.get_row(klass, rowid)
    resp = framework.ResponseDocument(request, doc_constructor,
             title="Table %s %s" % (tablename, dbrow))
    NM = resp.nodemaker
    resp.new_para(
            (NM("A", {"href": request.get_url(addentry, tablename=tablename)},
                resp.get_icon("add")),
            NM("A", {"href": request.get_url(edit, tablename=tablename, rowid=rowid)},
                resp.get_icon("edit")),
            NM("A", {"href": "javascript:doDeleteItem(%r, %r);" % (tablename, rowid)},
                resp.get_icon("delete")),
            ))
    cycler = itertools.cycle(["row1", "row2"])
    tbl = resp.doc.add_table(width="100%", class_="rowdisplay")
    tbl.caption("%s #%s" % (tablename, rowid))
    tbl.new_headings("Field", "Value")
    for metadata in sorted(models.get_metadata(klass)):
        row = tbl.new_row()
        setattr(row, "class_", cycler.next())
        row.new_column(metadata.colname)
        row.new_column(str(getattr(dbrow, metadata.colname)))
    return resp.finalize()
dataset/ETHPy150Open kdart/pycopia/storage/pycopia/db/webservice.py/view/original