1. Ralph Bean
  2. tw2.jqplugins.chosen


Moritz Schlarb  committed 09969c0

Some docs

  • Participants
  • Parent commits 26a8e06
  • Branches default

Comments (0)

Files changed (3)

File tests/test_widget.py

View file
  • Ignore whitespace
 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>"""

File tw2/jqplugins/chosen/__init__.py

View file
  • Ignore whitespace
+Chosen is a JavaScript plugin that makes long,
+unwieldy select boxes much more user-friendly.
+For more information about Chosen, see:
 from widgets import *

File tw2/jqplugins/chosen/widgets.py

View file
  • Ignore whitespace
 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'''