Commits

Moritz Schlarb committed 09969c0

Some docs

Comments (0)

Files changed (3)

tests/test_widget.py

 from tw2.core.testbase import WidgetTest
 from tw2.jqplugins.chosen import *
 
-class Chosen(WidgetTest):
+class ChosenMixin(WidgetTest):
     # place your widget at the TestWidget attribute
-    widget = Chosen
-    # Initilization args. go here 
+    widget = ChosenMixin
+    # Initialization args. go here 
     attrs = {'id':'chosen-test'}
     params = {}
     expected = """<div id="chosen-test"></div>"""

tw2/jqplugins/chosen/__init__.py

+'''
+Chosen is a JavaScript plugin that makes long,
+unwieldy select boxes much more user-friendly.
+
+For more information about Chosen, see:
+http://harvesthq.github.com/chosen/
+'''
+
 from widgets import *

tw2/jqplugins/chosen/widgets.py

 
 
 class ChosenMixin(twc.Widget):
+    '''Mixin for Chosen SelectFields'''
     resources = [chosen_js, chosen_css]
 
     selector = twc.Variable("Escaped id.  jQuery selector.")
 
 
 class ChosenSingleSelectField(ChosenMixin, twf.SingleSelectField):
-
+    '''SingleSelectField, enhanced with Chosen javascript'''
     def prepare(self):
         # If field is not required, this adds a button for deselection
         if not self.required:
 
 
 class ChosenMultipleSelectField(ChosenMixin, twf.MultipleSelectField):
+    '''MultipleSelectField, enhanced with Chosen javascript'''
     pass