Changeset 8299 for main/waeup.kofa/trunk/src
- Timestamp:
- 28 Apr 2012, 05:10:27 (13 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
r8268 r8299 1009 1009 self.assertTrue('Student is in the wrong state' 1010 1010 in self.browser.contents) 1011 # The CA can go to his certificate throug the my_roles page1011 # The CA can go to his certificate through the my_roles page 1012 1012 self.browser.open('http://localhost/app/users/mrsadvise/my_roles') 1013 1013 self.browser.getLink( -
main/waeup.kofa/trunk/src/waeup/kofa/university/certificate.py
r7819 r8299 21 21 from zope.event import notify 22 22 from zope.catalog.interfaces import ICatalog 23 from zope.intid.interfaces import IIntIds 24 from zope.schema import getFields 23 25 from zope.component import getUtility 24 26 from zope.component.interfaces import IFactory, ComponentLookupError 25 27 from zope.interface import implementedBy 28 from waeup.kofa.interfaces import IKofaPluggable 26 29 from waeup.kofa.university.interfaces import ( 27 30 ICertificate, ICertificateAdd, ICertificateCourse) … … 45 48 def __init__(self, code=u'NA', title=u'Unnamed Certificate', 46 49 study_mode=None, start_level=None, 47 end_level=None, application_category=None): 50 end_level=None, application_category=None, 51 school_fee_1=None, school_fee_2=None): 48 52 super(Certificate, self).__init__() 49 53 self.code = code … … 53 57 self.end_level = end_level 54 58 self.application_category = application_category 59 self.school_fee_1 = school_fee_1 60 self.school_fee_2 = school_fee_2 55 61 56 62 def longtitle(self): … … 147 153 student.loggerInfo('ObjectRemovedEvent', 'removed: certificate') 148 154 return 155 156 class CertificatesPlugin(grok.GlobalUtility): 157 """A plugin that updates certificates. 158 """ 159 160 grok.implements(IKofaPluggable) 161 grok.name('certificates') 162 163 def setup(self, site, name, logger): 164 return 165 166 def update(self, site, name, logger): 167 cat = getUtility(ICatalog, name='certificates_catalog') 168 results = cat.apply({'code':(None,None)}) 169 uidutil = getUtility(IIntIds, context=cat) 170 items = getFields(ICertificate).items() 171 for r in results: 172 o = uidutil.getObject(r) 173 for i in items: 174 if getattr(o,i[0],None) is None: 175 setattr(o,i[0],i[1].missing_value) 176 logger.info( 177 'CertificatesPlugin: %s attribute %s added.' % ( 178 o.code,i[0])) 179 return -
main/waeup.kofa/trunk/src/waeup/kofa/university/interfaces.py
r7819 r8299 198 198 title = schema.TextLine( 199 199 title = _(u'Title'), 200 default = _(u'Unnamed '),200 default = _(u'Unnamed Certificate'), 201 201 required = True, 202 202 ) … … 230 230 ) 231 231 232 school_fee_1 = schema.Float( 233 title = _(u'Initial School Fee'), 234 required = False, 235 ) 236 237 school_fee_2 = schema.Float( 238 title = _(u'Returning School Fee'), 239 required = False, 240 ) 241 232 242 def longtitle(): 233 243 """
Note: See TracChangeset for help on using the changeset viewer.