fix merge conflict
This commit is contained in:
commit
fdc9d119ba
4 changed files with 16 additions and 3 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -1,2 +1,6 @@
|
|||
*.pyc
|
||||
ajax/dojo/*
|
||||
.project
|
||||
.pydevproject
|
||||
.settings
|
||||
|
||||
|
|
|
@ -344,7 +344,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')
|
||||
|
|
|
@ -53,7 +53,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
|
@ -71,7 +71,6 @@ def year(d=None):
|
|||
d = datetime.today()
|
||||
return d.year
|
||||
|
||||
|
||||
def toLocalTime(d):
|
||||
if pytz is None or not d:
|
||||
return d
|
||||
|
@ -82,3 +81,13 @@ def toLocalTime(d):
|
|||
return d.astimezone(cet)
|
||||
except ValueError:
|
||||
return d
|
||||
|
||||
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