fixed an issue with lack of validators in 'double' type
This commit is contained in:
+4
-2
@@ -10261,8 +10261,10 @@ class Field(Expression):
|
||||
|
||||
def formatter(self, value):
|
||||
requires = self.requires
|
||||
if value is None or not requires:
|
||||
return value or self.map_none
|
||||
if value is None:
|
||||
return self.map_none
|
||||
if not requires:
|
||||
return value
|
||||
if not isinstance(requires, (list, tuple)):
|
||||
requires = [requires]
|
||||
elif isinstance(requires, tuple):
|
||||
|
||||
@@ -1863,6 +1863,7 @@ class INPUT(DIV):
|
||||
t = self['_type'] = 'text'
|
||||
t = t.lower()
|
||||
value = self['value']
|
||||
|
||||
if self['_value'] is None or isinstance(self['_value'],cgi.FieldStorage):
|
||||
_value = None
|
||||
else:
|
||||
|
||||
+2
-3
@@ -1140,12 +1140,12 @@ class SQLFORM(FORM):
|
||||
default = field.default
|
||||
if isinstance(default, CALLABLETYPES):
|
||||
default = default()
|
||||
|
||||
cond = readonly or \
|
||||
(not ignore_rw and not field.writable and field.readable)
|
||||
|
||||
if default is not None and not cond:
|
||||
if default is not None and not cond:
|
||||
default = field.formatter(default)
|
||||
|
||||
dspval = default
|
||||
inpval = default
|
||||
|
||||
@@ -1599,7 +1599,6 @@ class SQLFORM(FORM):
|
||||
fields[fieldname] = self.vars[fieldname]
|
||||
|
||||
if dbio:
|
||||
print fields
|
||||
for fieldname in fields:
|
||||
if fieldname in self.extra_fields:
|
||||
del fields[fieldname]
|
||||
|
||||
Reference in New Issue
Block a user