Anonymous avatar Anonymous committed 05c803d

Rename grid classes.

Comments (0)

Files changed (3)

 
 * webhelpers.html.grid / webhelpers.pylonslib.grid:
 
-  - Updates by Ergo, including SQLAlchemy grid classes, and styling.
+  - Updates by Ergo, including SQLAlchemy object grid classes, and styling.
+  - Rename classes: ObjectGrid, PylonsGrid, PylonsObjectGrid.
 
 * webhelpers.misc:
 

webhelpers/html/grid.py

             return HTML.tag("td", header_label, class_=class_name)
 
 
-class GridSqlalchemy(Grid):
-    """ This grid will work well with sqlalchemy row instances """
+class ObjectGrid(Grid):
+    """ A grid class for a sequence of objects.
+    
+    This grid class assumes that the rows are objects rather than dicts, and
+    uses attribute access to retrieve the column values. It works well with
+    SQLAlchemy ORM instances.
+    """
     def default_column_format(self, column_number, i, record, column_name):
         class_name = "c%s" % (column_number)
         return HTML.tag("td", getattr(record, column_name), class_=class_name)

webhelpers/pylonslib/grid.py

 class NoRequestError(Exception):
     pass
 
-class GridPylons(grid.Grid):
+class PylonsGrid(grid.Grid):
     """
     Subclass of Grid that can handle header link generation for quick building
     of tables that support ordering of their contents, paginated results etc.
             return self.default_header_column_format(column_number, column,
                                                      label_text)
 
-class GridPylonsSqlalchemy(GridPylons):
+class PylonsObjectGrid(PylonsGrid):
     """ This grid will work well with sqlalchemy row instances """
     def default_column_format(self, column_number, i, record, column_name):
         class_name = "c%s" % (column_number)
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.