Changeset 7351
- Timestamp:
- 15 Dec 2011, 12:04:13 (13 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp
- Files:
-
- 1 deleted
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/applicants/applicant.py
r7347 r7351 115 115 student['studycourse'].certificate = self.course_admitted 116 116 # Create StudentApplication object ... 117 application = createObject(u'waeup.StudentApplication')117 #application = createObject(u'waeup.StudentApplication') 118 118 # ... copy applicant base data 119 form_fields = grok.AutoFields(IApplicantBaseData)120 field_names = [i.__name__ for i in form_fields]121 for name in field_names:122 value = getattr(self,name,None)123 if value:124 setattr(application,name,value)125 site['students'][student.student_id]['application'] = application119 #form_fields = grok.AutoFields(IApplicantBaseData) 120 #field_names = [i.__name__ for i in form_fields] 121 #for name in field_names: 122 # value = getattr(self,name,None) 123 # if value: 124 # setattr(application,name,value) 125 #site['students'][student.student_id]['application'] = application 126 126 return True, 'Student %s created' % student.student_id 127 127 -
main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser.py
r7347 r7351 473 473 """ 474 474 course_admitted = self.context.course_admitted 475 if ICertificate.providedBy(course_admitted):475 if getattr(course_admitted, '__parent__',None): 476 476 url = self.url(course_admitted) 477 477 title = course_admitted.title … … 688 688 """ 689 689 course_admitted = self.context.course_admitted 690 if ICertificate.providedBy(course_admitted): 690 #if ICertificate.providedBy(course_admitted): 691 if getattr(course_admitted, '__parent__',None): 691 692 title = course_admitted.title 692 693 code = course_admitted.code … … 763 764 764 765 course_admitted = self.context.course_admitted 765 if ICertificate.providedBy(course_admitted):766 if getattr(course_admitted, '__parent__',None): 766 767 f_label = '<font size=12>Department:</font>' 767 768 f_text = '<font size=12>%s</font>' % ( … … 847 848 form_fields = grok.AutoFields(IApplicant) 848 849 form_fields['date_of_birth'].custom_widget = FriendlyDateWidget('le-year') 850 form_fields['student_id'].for_display = True 849 851 grok.template('applicanteditpage') 850 852 manage_applications = True … … 993 995 actions = [['Save', 'Final Submit'], 994 996 ['Remove selected tickets']] 995 el if state == SUBMITTED:997 else: 996 998 actions = [[],[]] 997 999 return actions -
main/waeup.sirp/trunk/src/waeup/sirp/applicants/interfaces.py
r7347 r7351 396 396 title = u'Student Id', 397 397 required = False, 398 readonly = True,398 readonly = False, 399 399 ) 400 400 locked = schema.Bool( -
main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py
r7344 r7351 102 102 return self.context.fullname 103 103 104 class ApplicationBreadcrumb(Breadcrumb):105 """A breadcrumb for the application data.106 """107 grok.context(IApplicantBaseData)108 title = 'Application'109 110 104 class SudyCourseBreadcrumb(Breadcrumb): 111 105 """A breadcrumb for the student study course. … … 475 469 write_log_message(self, 'saved: % s' % fields_string) 476 470 return 477 478 class StudentApplicationDisplayFormPage(SIRPDisplayFormPage):479 """ Page to display application data480 """481 grok.context(IApplicantBaseData)482 grok.name('index')483 grok.require('waeup.viewStudent')484 form_fields = grok.AutoFields(IApplicantBaseData)485 form_fields['date_of_birth'].custom_widget = FriendlyDateDisplayWidget('le')486 title = 'Application Data'487 pnav = 4488 489 @property490 def label(self):491 return '%s: Application Data' % self.context.getStudent().fullname492 471 493 472 class StudentClearanceDisplayFormPage(SIRPDisplayFormPage): -
main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_browser.py
r7340 r7351 368 368 self.assertMatches('...Student admitted by zope.mgr...', 369 369 self.browser.contents) 370 # Only the StudentApplication objectdoes not exist371 self.assertFalse('Application Data' in self.browser.contents)370 # Only the Application Slip does not exist 371 self.assertFalse('Application Slip' in self.browser.contents) 372 372 return 373 373 -
main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_student.py
r7339 r7351 21 21 from zope.interface import verify 22 22 from waeup.sirp.students.student import Student, StudentFactory 23 from waeup.sirp.students.application import StudentApplication24 23 from waeup.sirp.students.studycourse import StudentStudyCourse 25 24 from waeup.sirp.students.studylevel import StudentStudyLevel, CourseTicket … … 40 39 super(StudentTest, self).setUp() 41 40 self.student = Student() 42 self.application = StudentApplication()43 41 self.studycourse = StudentStudyCourse() 44 42 self.studylevel = StudentStudyLevel() … … 56 54 verify.verifyClass(IStudent, Student) 57 55 verify.verifyObject(IStudent, self.student) 58 verify.verifyClass(IApplicantBaseData, StudentApplication)59 verify.verifyObject(IApplicantBaseData, self.application)60 56 verify.verifyClass(IStudentStudyCourse, StudentStudyCourse) 61 57 verify.verifyObject(IStudentStudyCourse, self.studycourse) -
main/waeup.sirp/trunk/src/waeup/sirp/students/viewlets.py
r7340 r7351 67 67 class StudentManageApplicationLink(StudentManageLink): 68 68 grok.order(2) 69 link = 'application '70 text = u'Application Data'69 link = 'application_slip' 70 text = u'Application Slip' 71 71 72 72 def render(self): 73 application = self.context.getStudent().get(self.link) 74 if application is not None: 75 url = self.view.url(application) 73 slip = getUtility(IExtFileStore).getFileByContext( 74 self.context.getStudent(), attr=self.link) 75 if slip: 76 url = self.view.url(self.context,self.link) 76 77 return u'<div class="portlet"><a href="%s">%s</a></div>' % ( 77 78 url, self.text) … … 141 142 text = u'Base Data' 142 143 143 class StudentApplicationLink(StudentLink):144 class ApplicationSlipLink(StudentLink): 144 145 grok.order(2) 145 link = 'application '146 text = u'Application Data'146 link = 'application_slip' 147 text = u'Application Slip' 147 148 148 149 @property 149 150 def target_url(self): 150 application = self.context.getStudent().get(self.link) 151 if application is not None: 152 return self.view.url(application) 151 slip = getUtility(IExtFileStore).getFileByContext( 152 self.context.getStudent(), attr=self.link) 153 if slip: 154 return self.view.url(self.context,self.link) 153 155 return 154 156 … … 437 439 438 440 class Image(grok.View): 439 """Renders jpegimages for students.441 """Renders images for students. 440 442 """ 441 443 grok.baseclass() … … 472 474 grok.context(IStudent) 473 475 476 class ApplicationSlipImage(Image): 477 """Renders application slip scan. 478 """ 479 grok.name('application_slip') 480 download_name = u'application_slip' 481 474 482 class BirthCertificateImage(Image): 475 """Renders birth certificate jpegscan.483 """Renders birth certificate scan. 476 484 """ 477 485 grok.name('birth_certificate') … … 479 487 480 488 class AcceptanceLetterImage(Image): 481 """Renders acceptance letter jpegscan.489 """Renders acceptance letter scan. 482 490 """ 483 491 grok.name('acceptance_letter')
Note: See TracChangeset for help on using the changeset viewer.