Use alternate "DottedDecimalField" for decimal form fields
authorThierry Florac <tflorac@ulthar.net>
Mon, 07 Oct 2019 13:39:50 +0200
changeset 1367 7e8c67848061
parent 1366 3c6e0134064f
child 1368 570cb7fce4d6
Use alternate "DottedDecimalField" for decimal form fields
src/pyams_content/shared/form/field.py
--- a/src/pyams_content/shared/form/field.py	Mon Oct 07 13:38:33 2019 +0200
+++ b/src/pyams_content/shared/form/field.py	Mon Oct 07 13:39:50 2019 +0200
@@ -18,7 +18,7 @@
 from zope.container.ordered import OrderedContainer
 from zope.interface import implementer
 from zope.location.interfaces import ISublocations
-from zope.schema import Bool, Choice, Date, Decimal, Int, List, Text, TextLine, URI
+from zope.schema import Bool, Choice, Date, Int, List, Text, TextLine, URI
 from zope.schema.fieldproperty import FieldProperty
 from zope.traversing.interfaces import ITraversable
 
@@ -34,7 +34,7 @@
 from pyams_utils.factory import factory_config
 from pyams_utils.registry import get_global_registry, utility_config
 from pyams_utils.request import check_request
-from pyams_utils.schema import MailAddressField
+from pyams_utils.schema import DottedDecimalField, MailAddressField
 from pyams_utils.traversing import get_parent
 from pyams_utils.vocabulary import vocabulary_config
 
@@ -192,7 +192,7 @@
     label = _("Decimal")
     weight = 5
 
-    field_factory = Decimal
+    field_factory = DottedDecimalField
 
 
 @utility_config(name='date', provides=IFormFieldFactory)