Changeset 6327 for main/waeup.sirp/trunk/src/waeup
- Timestamp:
- 10 Jun 2011, 10:20:44 (13 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp/applicants
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser.py
r6325 r6327 359 359 @grok.action('Add applicant', validator=NullValidator) 360 360 def addApplicant(self, **data): 361 return self.flash('Manual addition of applicants not yet implemented!') 361 self.redirect(self.url(self.context, 'addapplicant')) 362 return 362 363 363 364 @grok.action('Cancel', validator=NullValidator) … … 426 427 return 427 428 429 class ApplicantAddFormPage(WAeUPAddFormPage): 430 """Add-form to add certificate to a department. 431 """ 432 grok.context(IApplicantsContainer) 433 grok.require('waeup.manageApplications') 434 grok.name('addapplicant') 435 grok.template('applicantaddpage') 436 title = 'Applicants' 437 label = 'Add applicant' 438 pnav = 3 439 440 @property 441 def title(self): 442 return "Applicants Container: %s" % self.context.title 443 444 @property 445 def ac_prefix(self): 446 return self.context.ac_prefix 447 448 @grok.action('Create application record') 449 def addApplicant(self, **data): 450 ac_series = self.request.form.get('form.ac_series', None) 451 ac_number = self.request.form.get('form.ac_number', None) 452 pin = '%s-%s-%s' % (self.ac_prefix,ac_series,ac_number) 453 if pin not in self.context.keys(): 454 # Create applicant record 455 applicant = Applicant() 456 applicant.access_code = pin 457 self.context[pin] = applicant 458 self.redirect(self.url(self.context[pin], 'edit')) 459 return 460 428 461 class AccessCodeLink(LeftSidebarLink): 429 462 grok.order(1) -
main/waeup.sirp/trunk/src/waeup/sirp/applicants/interfaces.py
r6324 r6327 284 284 """ 285 285 msgs = Attribute('Workflow transitions with date of transition.') 286 getApplicationState = Attribute('Returns the application state of an applicant') 286 287 287 288 reg_no = schema.TextLine( … … 388 389 default = False, 389 390 ) 390 391 def getApplicationState():392 """393 Returns the application state of an applicant.394 """395 391 396 392 class IApplicant(IApplicantBaseData):
Note: See TracChangeset for help on using the changeset viewer.