Ignore:
Timestamp:
13 Jun 2012, 13:29:35 (13 years ago)
Author:
Henrik Bettermann
Message:

Add more attributes to webservice adapter.

Location:
main/waeup.kofa/trunk/src/waeup/kofa/students
Files:
3 edited

Legend:

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

    r8703 r8708  
    137137
    138138    @property
    139     def payee(self):
     139    def display_fullname(self):
     140        "Name of  payee."
    140141        return self.context.getStudent().display_fullname
     142
     143    @property
     144    def id(self):
     145        "Id of payee"
     146        return self.context.getStudent().student_id
     147
     148    @property
     149    def faculty(self):
     150        "Faculty of payee"
     151        return self.context.getStudent().faccode
     152
     153    @property
     154    def department(self):
     155        "Department of payee"
     156        return self.context.getStudent().depcode
    141157
    142158# Student online payments must be importable. So we might need a factory.
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py

    r8703 r8708  
    159159        self.certificate.school_fee_1 = 40000.0
    160160        self.certificate.school_fee_2 = 20000.0
    161         self.app['faculties']['fac1'] = Faculty()
     161        self.app['faculties']['fac1'] = Faculty(code='fac1')
    162162        self.app['faculties']['fac1']['dep1'] = Department(code='dep1')
    163163        self.app['faculties']['fac1']['dep1'].certificates.addCertificate(
     
    14751475
    14761476        # Student is the payee of the payment ticket.
    1477         self.assertEqual(IPaymentWebservice(
    1478             self.student['payments'][value]).payee, 'Anna Tester')
     1477        webservice = IPaymentWebservice(self.student['payments'][value])
     1478        self.assertEqual(webservice.display_fullname, 'Anna Tester')
     1479        self.assertEqual(webservice.id, self.student_id)
     1480        self.assertEqual(webservice.faculty, 'fac1')
     1481        self.assertEqual(webservice.department, 'dep1')
    14791482
    14801483        # We simulate the approval
  • main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py

    r8688 r8708  
    225225    """
    226226    grok.implements(IStudentsUtils)
    227     paymentfactory = u'waeup.StudentOnlinePayment'
    228227
    229228    def getReturningData(self, student):
     
    305304               ticket.p_session == p_session:
    306305                  return _('This type of payment has already been made.'), None
    307         payment = createObject(self.paymentfactory)
     306        payment = createObject(u'waeup.StudentOnlinePayment')
    308307        timestamp = "%d" % int(time()*1000)
    309308        payment.p_id = "p%s" % timestamp
Note: See TracChangeset for help on using the changeset viewer.