Mike Orr avatar Mike Orr committed fc2f641

Descriptions and refactoring.

Comments (0)

Files changed (1)

unfinished/grid_demo.py

 from webhelpers.html import *
 from webhelpers.html.grid import Grid
 from webhelpers.html.tags import link_to
+from webhelpers.misc import subclasses_only
 # XXX You may find other helpers in webhelpers.html.tags useful too
 
 #### Global constants ####
 class BasicDemo(_DemoBase):
     name = "Tickets"
     description = """\
-This table shows Basic grid."""
+This table shows a basic grid."""
 
     def get_grid(self):
         """
 class CustomColumnDemo(_DemoBase):
     name = "CustomColumn"
     description = """\
-This table shows grid with customized column and header label."""
+This table shows a grid with a customized column and header label."""
 
     def get_grid(self):
         """
-        lets override how rows look like
+        let's override how rows look like
         subject is link
         categories and status hold text based on param of item text , the
         translations are dicts holding translation strings correlated with
             }
         return g
 
-#demos = [x for x in globals().iteritems() if\
-#    isinstance(x, _DemoBase) and x is not _DemoBase]
+demos = subclasses_only(_DemoBase, globals())
 
-demos = [BasicDemo, CustomColumnDemo]
+#demos = [BasicDemo, CustomColumnDemo]
 
 #### Utility functions ####
 def url(urlpath, **params):
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.