WebHelpers / unfinished / grid_test.py

from webhelpers.html import HTML, literal
import webhelpers.html.grid as grid
import webhelpers.pylonslib.grid_pylons as grid_pylons

def options_td(col_num, i, item):
    return HTML.td("baz", class_="c%s" % (col_num))

test_data = [
     {"group_name": "foo", "options": "lalala"},
     {"group_name": "foo2", "options": "lalala2"},
     {"group_name": "foo3", "options": "lalala3"},
     {"group_name": "foo4", "options": "lalala4"},
     ]

test_grid = grid.Grid(test_data, columns=["_numbered","group_name","options"])
test_grid.exclude_ordering = test_grid.columns
test_grid.format = {
    "options": options_td,
    }

print "<table>"
print test_grid
print "</table>"
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.