diff --git a/fields/boolean.py b/fields/boolean.py index 191f62d..9004e89 100644 --- a/fields/boolean.py +++ b/fields/boolean.py @@ -23,29 +23,52 @@ from appy.gen.layout import Table class Boolean(Field): '''Field for storing boolean values.''' + yesNo = {'true': 'yes', 'false': 'no', True: 'yes', False: 'no'} + trueFalse = {True: 'true', False: 'false'} + + # Default layout (render = "checkbox") ("b" stands for "base"). + bLayouts = {'view': 'lf', 'edit': Table('f;lrv;=', width=None), + 'search': 'l-f'} + # Layout including a description. + dLayouts = {'view': 'lf', 'edit': Table('flrv;=d', width=None)} + # Centered layout, no description. + cLayouts = {'view': 'lf|', 'edit': 'flrv|'} + # Layout for radio buttons (render = "radios") + rLayouts = {'edit': 'f', 'view': 'f', 'search': 'l-f'} + pxView = pxCell = Px(''':value ''') - pxEdit = Px(''' - + pxEdit = Px(''' + - ''') + value=":isTrue and 'True' or 'False'"/> + + + +
+ + +
''') pxSearch = Px(''' - + - +