Login

Geraldo Reports Currency class update for DecimalObjectValue

Author:
alaska2008
Posted:
March 19, 2015
Language:
Python
Version:
Not specified
Tags:
django Geraldoreports
Score:
1 (after 1 ratings)

Adds init and changes passed args to args and *kwargs .

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
class DecimalObjectValue(ObjectValue):
    format = '%0.02f'

    def __init__(self, *args, **kwargs):
        super(DecimalObjectValue, self).__init__(*args,**kwargs)

    def get_object_value(self, *args, **kwargs):
        value = super(DecimalObjectValue, self).get_object_value(*args,**kwargs)

        if not value:
            value = 0

        return self.format%value

More like this

Comments

Please login first before commenting.