Ignore:
Timestamp:
13 Jun 2012, 06:32:13 (12 years ago)
Author:
Henrik Bettermann
Message:

Let's better use an adapter for the webservice.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/students/payments.py

    r8702 r8703  
    2626    IStudentPaymentsContainer, IStudentNavigation, IStudentOnlinePayment)
    2727from waeup.kofa.payments import PaymentsContainer, OnlinePayment
     28from waeup.kofa.payments.interfaces import IPaymentWebservice
    2829from waeup.kofa.utils.helpers import attrs_to_fields
    2930from waeup.kofa.accesscodes import create_accesscode
     
    5960        except AttributeError:
    6061            return None
    61 
    62     def getOwner(self):
    63         return self.getStudent()
    6462
    6563    def doAfterStudentPayment(self):
     
    132130StudentOnlinePayment = attrs_to_fields(StudentOnlinePayment)
    133131
     132class PaymentWebservice(grok.Adapter):
     133    """An adapter to publish student data through a webservice.
     134    """
     135    grok.context(IStudentOnlinePayment)
     136    grok.implements(IPaymentWebservice)
     137
     138    @property
     139    def payee(self):
     140        return self.context.getStudent().display_fullname
     141
    134142# Student online payments must be importable. So we might need a factory.
    135143class StudentOnlinePaymentFactory(grok.GlobalUtility):
Note: See TracChangeset for help on using the changeset viewer.