use float as fallback for number field
git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@3002 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
parent
1d80425012
commit
2848522923
1 changed files with 4 additions and 1 deletions
|
@ -186,7 +186,10 @@ class NumberFieldInstance(FieldInstance):
|
|||
def unmarshall(self, value):
|
||||
if not value:
|
||||
return None
|
||||
return int(value)
|
||||
try:
|
||||
return int(value)
|
||||
except (TypeError, ValueError):
|
||||
return float(value)
|
||||
|
||||
def validate(self, value, data=None):
|
||||
if value in ('', None):
|
||||
|
|
Loading…
Add table
Reference in a new issue