- Timestamp:
- 9 Mar 2015, 01:51:12 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/branches/uli-payments/src/waeup/ikoba/customers/contracts.py
r12683 r12697 32 32 IContractSelectProduct, ICustomersUtils, ISampleContract, 33 33 ISampleContractProcess, ISampleContractEdit, ISampleContractOfficialUse) 34 from waeup.ikoba.payments.interfaces import IPay mentItem34 from waeup.ikoba.payments.interfaces import IPayer 35 35 from waeup.ikoba.payments.payment import PaymentItem 36 36 from waeup.ikoba.utils.helpers import attrs_to_fields … … 71 71 result.append(item) 72 72 return result 73 74 75 class ContractPayer(grok.Adapter): 76 """Adapter to turn contracts into IPayers. 77 """ 78 grok.implements(IPayer) 79 grok.context(IContract) 80 81 def __init__(self, context): 82 self.context = context 83 84 @property 85 def _customer(self): 86 # XXX: contracts have no `customer` in interface. 87 return self.context.customer 88 89 @property 90 def first_name(self): 91 return getattr(self._customer, 'firstname', None) 92 93 @property 94 def last_name(self): 95 return getattr(self._customer, 'lastname', None) 96 97 @property 98 def payer_id(self): 99 return getattr(self._customer, 'customer_id', None) 73 100 74 101
Note: See TracChangeset for help on using the changeset viewer.