Changeset 6080 for main/waeup.sirp/trunk/src/waeup/sirp/applicants
- Timestamp:
- 14 May 2011, 00:47:59 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser.py
r6078 r6080 27 27 from hurry.jquery import jquery 28 28 from hurry.jqueryui import jqueryui 29 from zope.component import getUtility, getAllUtilitiesRegisteredFor,createObject29 from zope.component import getUtility, createObject 30 30 from zope.formlib.widgets import FileWidget, DateWidget 31 31 from zope.securitypolicy.interfaces import IPrincipalRoleManager … … 54 54 from waeup.sirp.widgets.restwidget import ReSTWidget 55 55 56 #from zope.formlib.objectwidget import ObjectWidget57 56 from zope.formlib.sequencewidget import ListSequenceWidget, SequenceDisplayWidget 58 57 from zope.formlib.widget import CustomWidgetFactory … … 71 70 results_display_widget = CustomWidgetFactory( 72 71 WAeUPObjectDisplayWidget, ResultEntry) 73 74 #list_results_widget = CustomWidgetFactory(75 # ListSequenceWidget, subwidget=results_widget)76 72 77 73 list_results_widget = CustomWidgetFactory( … … 187 183 self.redirect(self.url(self.context)) 188 184 189 #def getContainerProviders(self):190 # """Get a list of applicants container providers.191 #192 # Applicants container providers are named utilities that help193 # to create applicants containers of different types194 # (JAMB-based, non-JAMB-based, etc.).195 #196 # The list returned contains dicts::197 #198 # {'name': <utility_name>,199 # 'provider': <provider instance>}200 #201 # where `utility_name` is the name under which the respective202 # provider utility is registered and `provider` is the real203 # provider instance.204 #205 # The `utility_name` can be used to lookup the utility anew (for206 # instance after submitting a form) and the `provider` instance207 # can be used to create new instances of the respective208 # applicants container type.209 # """210 # providers = getAllUtilitiesRegisteredFor(IApplicantsContainerProvider)211 # result = [212 # {'name': getattr(x, 'grokcore.component.directive.name'),213 # 'provider': x}214 # for x in providers215 # ]216 # return result217 218 185 class ApplicantsRootBreadcrumb(Breadcrumb): 219 186 """A breadcrumb for applicantsroot. … … 359 326 self.redirect(self.url(self.context[pin], 'edit')) 360 327 return 361 362 #class AddApplicant(WAeUPAddFormPage):363 # grok.context(IApplicantsContainer)364 # grok.name('add')365 # form_fields = grok.AutoFields(IApplicant)366 # form_fields['fst_sit_results'].custom_widget = list_results_widget367 # form_fields['passport'].custom_widget = EncodingImageFileWidget368 # label = 'Add Applicant'369 # title = 'Add Applicant'370 # pnav = 1371 #372 # @grok.action('Add applicant')373 # def addApplicant(self, **data):374 # from waeup.sirp.jambtables.applicants import Applicant375 # applicant = Applicant()376 # self.applyData(applicant, **data)377 # # XXX: temporarily disabled.378 # #self.context[applicant.reg_no] = applicant379 # try:380 # self.context[applicant.access_code] = applicant381 # except KeyError:382 # self.flash('The given access code is already in use!')383 # return384 # self.redirect(self.url(self.context))385 328 386 329 class DisplayApplicant(WAeUPDisplayFormPage):
Note: See TracChangeset for help on using the changeset viewer.