From eaad1ce9bd220aabc6fc21a7604d8e527d04513d Mon Sep 17 00:00:00 2001 From: helmutm Date: Fri, 3 Apr 2009 09:49:30 +0000 Subject: [PATCH] let FloatValue always correspond to True git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@3322 fd906abe-77d9-0310-91a1-e0d9ade77398 --- commerce/common.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/commerce/common.py b/commerce/common.py index 17e5536..816bfc6 100644 --- a/commerce/common.py +++ b/commerce/common.py @@ -118,6 +118,10 @@ class BaseObject(object): class FloatValue(float): + # TODO: rename to CurrencyValue + + def __nonzero__(self): + return True # even when value is 0.0 def __init__(self, value, decimals=2, currency=u'€'): self.decimals = decimals