Add digits mixin

issue10596
review338511002
This commit is contained in:
Cédric Krier committed 2021-08-21 09:05:34 +02:00
1 parent 9bf9b3a910
commit fb9238b8bf
8 files changed
+84 -14

No files matched your search

+2
View File
@@ -383,6 +383,8 @@ instance.
Integers can be replaced by a :class:`~trytond.pyson.PYSON` statement.
If digits is None or any values of the tuple is ``None``, no validation on
the numbers will be done.
The tuple can be replaced by a string containing the name of a
:class:`Many2One` pointing to a :class:`DigitsMixin`.
Numeric
-------
+15
View File
@@ -802,6 +802,21 @@ Instance methods:
(1) the value. If no symbol parameter is supplied then the mixin uses the
value of attribute named ``symbol``.
===========
DigitsMixin
===========
.. class:: DigitsMixin
A mixin_ to manage the digits of :attr:`Float.digits` and
:attr:`Numeric.digits` from a :class:`Model`.
Instance methods:
.. method:: DigitsMixin.get_digits()
Return a tuple of two integers to use a ``digits`` attribute.
================
sequence_ordered
================