* Betr.: " Re: [tryton] Zero-price items" (Thu, 12 May 2011 10:13:08 +0200):

> On 12/05/11 09:45 +0200, Paul J Stevens wrote:
> > This makes me wonder if perhaps the whole required state machinery needs
> > to be able to allow zero values on numeric fields to satisfy the
> > requirement. I'm well aware of where this comes from: in python numeric
> > values of zero evaluate to False. However, is a business context an
> > explicit zero-amount is *not* the same as an unspecified amount, or in
> > other words: 0 is not False, only False is False.
> 
> Have you ideas about how we could be sure to not have zero-amount per error?

Don't know if it is feasible, but if the validation of required could be made
on type string instead of integer, the difference between 0 and False could be
evaluated:

>>> False == 0
True
>>> 'False' == '0'
False


-- 

    Mathias Behrle
    MBSolutions
    Gilgenmatten 10 A
    D-79114 Freiburg

    Tel: +49(761)471023
    Fax: +49(761)4770816
    http://m9s.biz
    UStIdNr: DE 142009020
    PGP/GnuPG key availabable from any keyserver, ID: 0x8405BBF6

Attachment: signature.asc
Description: PGP signature

Reply via email to