Changeset 12646


Ignore:
Timestamp:
2 Mar 2015, 00:44:26 (10 years ago)
Author:
uli
Message:

Make amount a computed property (and clean up a bit).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.ikoba/branches/uli-fake-gw-provider/src/waeup/ikoba/payments/payment.py

    r12643 r12646  
    6060    logger_format_str = '"%(asctime)s","%(user)s",%(message)s'
    6161
     62    @property
     63    def amount(self):
     64        """The amount of a payment.
     65
     66        Equals the sum of items contained.
     67        """
     68        return sum([item.amount for item in self.values()])
     69
    6270    def __init__(self):
    6371        super(Payment, self).__init__()
     
    6573        self.payment_date = None
    6674        self.payment_id = u'PAY_' + unicode(uuid.uuid4().hex)
    67         #self.gateway_service = None
    68         self.amount = decimal.Decimal("0.00")
    69         #self.payed_item_id = None
    70         #self.payer_id = None
    7175        self.state = STATE_UNPAID
    7276        return
Note: See TracChangeset for help on using the changeset viewer.