fix: browserView getData setting for boolean field
This commit is contained in:
parent
17e86e64c7
commit
9e8ba76461
3 changed files with 13 additions and 2 deletions
|
@ -334,7 +334,7 @@ class EmailFieldInstance(FieldInstance):
|
|||
class BooleanFieldInstance(FieldInstance):
|
||||
|
||||
def marshall(self, value):
|
||||
return value
|
||||
return bool(value)
|
||||
|
||||
def display(self, value):
|
||||
#return value and _(u'Yes') or _(u'No')
|
||||
|
|
|
@ -55,7 +55,7 @@ class Instance(BaseInstance):
|
|||
fi = f.getFieldInstance(self, context=kw.get('context'),
|
||||
request=kw.get('request'))
|
||||
name = f.name
|
||||
value = getattr(self.context, name) or fi.default
|
||||
value = getattr(self.context, name, fi.default)
|
||||
if mode in ('view', 'preview'):
|
||||
value = fi.display(value)
|
||||
else:
|
||||
|
|
11
util/date.py
11
util/date.py
|
@ -65,3 +65,14 @@ def year(d=None):
|
|||
if d is None:
|
||||
d = datetime.today()
|
||||
return d.year
|
||||
|
||||
def month(d=None):
|
||||
if d is None:
|
||||
d = datetime.today()
|
||||
return d.month
|
||||
|
||||
def day(d=None):
|
||||
if d is None:
|
||||
d = datetime.today()
|
||||
return d.day
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue