[gen] CSS improvements; bugfix: parsing now works even if encoding is declared at the beginning of the Python file; a default layout for Boolean fields, including a description, is now available in Boolean.dLayouts.

This commit is contained in:
Gaetan Delannay 2012-05-31 17:29:06 +02:00
parent ede29fb6c1
commit e3b7f5364f
3 changed files with 12 additions and 4 deletions

View file

@ -1443,6 +1443,7 @@ class String(Type):
return self.getCaptchaChallenge({})['text']
class Boolean(Type):
def __init__(self, validator=None, multiplicity=(0,1), index=None,
default=None, optional=False, editDefault=False, show=True,
page='main', group=None, layouts = None, move=0, indexed=False,
@ -1458,8 +1459,9 @@ class Boolean(Type):
label)
self.pythonType = bool
dLayouts = {'view': 'lf', 'edit': Table('flrv;=d', width=None)}
def getDefaultLayouts(self):
return {'view': 'l;f!-', 'edit': Table('f;lrv;=', width=None)}
return {'view': 'lf', 'edit': Table('f;lrv;=', width=None)}
def getValue(self, obj):
'''Never returns "None". Returns always "True" or "False", even if