- Timestamp:
- 13 Feb 2011, 12:20:24 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/applicants/jambtables/browser.py
r5746 r5758 31 31 from waeup.sirp.interfaces import IWAeUPObject 32 32 from waeup.sirp.applicants.jambtables.util import get_applicant_data 33 from waeup.sirp.applicants. jambtables.interfaces import (34 IApplicant, IApplicant Container, IApplicantPrincipal, IApplicantPDEEditData)33 from waeup.sirp.applicants.interfaces import ( 34 IApplicant, IApplicantPrincipal, IApplicantPDEEditData) 35 35 from waeup.sirp.widgets.passportwidget import ( 36 36 PassportWidget, PassportDisplayWidget … … 39 39 from zope.formlib.sequencewidget import ListSequenceWidget, SequenceDisplayWidget 40 40 from zope.formlib.widget import CustomWidgetFactory 41 from waeup.sirp.applicants .jambtables.applicantsimport ResultEntry41 from waeup.sirp.applicants import ResultEntry 42 42 from waeup.sirp.widgets.objectwidget import ( 43 43 WAeUPObjectWidget, WAeUPObjectDisplayWidget) … … 63 63 MultiListDisplayWidget, subwidget=results_display_widget) 64 64 65 class ApplicationsPage(WAeUPPage):66 grok.context(IApplicantContainer)67 grok.name('index')68 title = 'Applications'69 pnav = 170 71 def getApplications(self):72 """Get a list of all stored applications.73 """74 for key, val in self.context.items():75 url = self.url(val)76 yield(dict(url=url, name=key))77 78 class AddApplicant(WAeUPAddFormPage):79 grok.context(IApplicantContainer)80 grok.name('add')81 form_fields = grok.AutoFields(IApplicant)82 form_fields['fst_sit_results'].custom_widget = list_results_widget83 form_fields['passport'].custom_widget = EncodingImageFileWidget84 label = 'Add Applicant'85 title = 'Add Applicant'86 pnav = 187 88 @grok.action('Add applicant')89 def addApplicant(self, **data):90 from waeup.sirp.jambtables.applicants import Applicant91 applicant = Applicant()92 self.applyData(applicant, **data)93 # XXX: temporarily disabled.94 #self.context[applicant.reg_no] = applicant95 try:96 self.context[applicant.access_code] = applicant97 except KeyError:98 self.flash('The given access code is already in use!')99 return100 self.redirect(self.url(self.context))65 #class ApplicationsPage(WAeUPPage): 66 # grok.context(IApplicantContainer) 67 # grok.name('index') 68 # title = 'Applications' 69 # pnav = 1 70 # 71 # def getApplications(self): 72 # """Get a list of all stored applications. 73 # """ 74 # for key, val in self.context.items(): 75 # url = self.url(val) 76 # yield(dict(url=url, name=key)) 77 78 #class AddApplicant(WAeUPAddFormPage): 79 # grok.context(IApplicantContainer) 80 # grok.name('add') 81 # form_fields = grok.AutoFields(IApplicant) 82 # form_fields['fst_sit_results'].custom_widget = list_results_widget 83 # form_fields['passport'].custom_widget = EncodingImageFileWidget 84 # label = 'Add Applicant' 85 # title = 'Add Applicant' 86 # pnav = 1 87 # 88 # @grok.action('Add applicant') 89 # def addApplicant(self, **data): 90 # from waeup.sirp.jambtables.applicants import Applicant 91 # applicant = Applicant() 92 # self.applyData(applicant, **data) 93 # # XXX: temporarily disabled. 94 # #self.context[applicant.reg_no] = applicant 95 # try: 96 # self.context[applicant.access_code] = applicant 97 # except KeyError: 98 # self.flash('The given access code is already in use!') 99 # return 100 # self.redirect(self.url(self.context)) 101 101 102 102 class DisplayApplicant(WAeUPDisplayFormPage):
Note: See TracChangeset for help on using the changeset viewer.