## $Id: payments.py 8741 2012-06-18 06:04:45Z henrik $ ## ## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 2 of the License, or ## (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program; if not, write to the Free Software ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ## """ Student payment components. """ import grok from zope.component.interfaces import IFactory from zope.interface import implementedBy from waeup.kofa.students.interfaces import IStudentNavigation from waeup.kofa.students.payments import ( StudentOnlinePayment, StudentOnlinePaymentFactory) from waeup.kofa.utils.helpers import attrs_to_fields from waeup.uniben.students.interfaces import ICustomStudentOnlinePayment class CustomStudentOnlinePayment(StudentOnlinePayment): """This is a custom online payment for students. Since this class inherits from StudentOnlinePayment, it automatically implements the interfaces of the parent class which means all viewlets and views meant for StudentOnlinePayment can also be accessed in the customized system. """ grok.implements(ICustomStudentOnlinePayment, IStudentNavigation) grok.provides(ICustomStudentOnlinePayment) def __init__(self): super(CustomStudentOnlinePayment, self).__init__() return @property def student(self): return self.__parent__.__parent__ CustomStudentOnlinePayment = attrs_to_fields(CustomStudentOnlinePayment) class CustomStudentOnlinePaymentFactory(StudentOnlinePaymentFactory): """A factory for student online payments. """ def __call__(self, *args, **kw): return CustomStudentOnlinePayment() def getInterfaces(self): return implementedBy(CustomStudentOnlinePayment)