Changeset 12780


Ignore:
Timestamp:
17 Mar 2015, 18:42:35 (10 years ago)
Author:
Henrik Bettermann
Message:

Update payment objects with PaymentsPlugin?.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.ikoba/trunk/src/waeup/ikoba/payments/container.py

    r12775 r12780  
    2020"""
    2121import grok
     22from zope.schema import getFields
    2223from waeup.ikoba.interfaces import IIkobaPluggable
    23 from waeup.ikoba.payments.interfaces import IPaymentsContainer
     24from waeup.ikoba.payments.interfaces import IPaymentsContainer, IPayment
    2425from waeup.ikoba.utils.helpers import attrs_to_fields
    2526from waeup.ikoba.utils.logger import Logger
     
    5051
    5152class PaymentsPlugin(grok.GlobalUtility):
    52     """A plugin that creates container for payments inside a company.
     53    """A plugin that creates container for payments inside a company
     54    and updates payment objects.
    5355    """
    5456    grok.implements(IIkobaPluggable)
     
    6668        if not 'payments' in site.keys():
    6769            self.setup(site, name, logger)
     70        for payment in site['payments'].values():
     71            # Add payment_items
     72            if not hasattr(payment,'payment_items'):
     73              payment.payment_items = ()
     74              logger.info(
     75                  'PaymentsPlugin: %s attribute %s added.' % (
     76                  payment.payment_id,'payment_items'))
     77        return
Note: See TracChangeset for help on using the changeset viewer.