Changeset 7364 for main/waeup.sirp/trunk/src/waeup
- Timestamp:
- 17 Dec 2011, 12:54:39 (13 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/applicants/applicant.py
r7359 r7364 71 71 72 72 @property 73 def fullname(self):73 def display_fullname(self): 74 74 middlename = getattr(self, 'middlename', None) 75 75 sirp_utils = getUtility(ISIRPUtils) -
main/waeup.sirp/trunk/src/waeup/sirp/applicants/authentication.py
r7255 r7364 38 38 @property 39 39 def title(self): 40 return self.context. fullname40 return self.context.display_fullname 41 41 42 42 @property -
main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser.py
r7363 r7364 563 563 def label(self): 564 564 return '%s: Online Payment Ticket %s' % ( 565 self.context.__parent__. fullname,self.context.p_id)565 self.context.__parent__.display_fullname,self.context.p_id) 566 566 567 567 class PaymentReceiptActionButton(ManageActionButton): -
main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser_templates/applicantscontainermanagepage.pt
r7246 r7364 84 84 </td> 85 85 <td> 86 <span tal:replace="appl/ fullname">Fullname86 <span tal:replace="appl/display_fullname">Fullname 87 87 </span> 88 88 </td> -
main/waeup.sirp/trunk/src/waeup/sirp/applicants/interfaces.py
r7356 r7364 384 384 history = Attribute('Object history, a list of messages.') 385 385 state = Attribute('The application state of an applicant') 386 fullname = Attribute('The fullname of an applicant')386 display_fullname = Attribute('The fullname of an applicant') 387 387 application_date = Attribute('Date of submission, used for export only') 388 388 password = Attribute('Encrypted password of a applicant') -
main/waeup.sirp/trunk/src/waeup/sirp/applicants/tests/test_authentication.py
r7255 r7364 60 60 class FakeApplicant(object): 61 61 applicant_id = 'test_appl' 62 fullname = 'Tilman Gause'62 display_fullname = 'Tilman Gause' 63 63 password = None 64 64 email = None -
main/waeup.sirp/trunk/src/waeup/sirp/browser/layout.py
r7328 r7364 231 231 """ 232 232 if IStudentNavigation.providedBy(self.context): 233 return self.context.getStudent(). fullname233 return self.context.getStudent().display_fullname 234 234 return 235 235 -
main/waeup.sirp/trunk/src/waeup/sirp/browser/templates/showstudentspage.pt
r7216 r7364 19 19 <span tal:content="item/student_id">A123456</span></a> 20 20 </td> 21 <td tal:content="item/ fullname">FULLNAME</td>21 <td tal:content="item/display_fullname">FULLNAME</td> 22 22 <td tal:content="item/state">STATE</td> 23 23 <td> -
main/waeup.sirp/trunk/src/waeup/sirp/students/authentication.py
r7316 r7364 50 50 @property 51 51 def title(self): 52 return self.context. fullname52 return self.context.display_fullname 53 53 54 54 @property -
main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py
r7358 r7364 100 100 101 101 def title(self): 102 return self.context. fullname102 return self.context.display_fullname 103 103 104 104 class SudyCourseBreadcrumb(Breadcrumb): … … 347 347 @property 348 348 def label(self): 349 return '%s: Base Data' % self.context. fullname349 return '%s: Base Data' % self.context.display_fullname 350 350 351 351 @property … … 378 378 379 379 def label(self): 380 return u'Send message to %s' % self.context. fullname380 return u'Send message to %s' % self.context.display_fullname 381 381 382 382 @grok.action('Send message now') … … 484 484 @property 485 485 def label(self): 486 return '%s: Clearance Data' % self.context. fullname486 return '%s: Clearance Data' % self.context.display_fullname 487 487 488 488 class StudentClearanceManageActionButton(ManageActionButton): … … 546 546 @property 547 547 def label(self): 548 return 'Clearance Slip of %s' % self.context. fullname548 return 'Clearance Slip of %s' % self.context.display_fullname 549 549 550 550 def render(self): … … 638 638 @property 639 639 def label(self): 640 return '%s: Personal Data' % self.context. fullname640 return '%s: Personal Data' % self.context.display_fullname 641 641 642 642 class StudentPersonalManageActionButton(ManageActionButton): … … 677 677 @property 678 678 def label(self): 679 return '%s: Study Course' % self.context.__parent__. fullname679 return '%s: Study Course' % self.context.__parent__.display_fullname 680 680 681 681 @property … … 800 800 def label(self): 801 801 return '%s: Study Level %s' % ( 802 self.context.getStudent(). fullname,self.context.level_title)802 self.context.getStudent().display_fullname,self.context.level_title) 803 803 804 804 @property … … 1064 1064 def label(self): 1065 1065 return '%s: Course Ticket %s' % ( 1066 self.context.getStudent(). fullname,self.context.code)1066 self.context.getStudent().display_fullname,self.context.code) 1067 1067 1068 1068 class CourseTicketManageActionButton(ManageActionButton): … … 1111 1111 # @property 1112 1112 # def label(self): 1113 # return '%s: Payments' % self.context.__parent__. fullname1113 # return '%s: Payments' % self.context.__parent__.display_fullname 1114 1114 1115 1115 # def update(self): … … 1138 1138 @property 1139 1139 def label(self): 1140 return '%s: Payments' % self.context.__parent__. fullname1140 return '%s: Payments' % self.context.__parent__.display_fullname 1141 1141 1142 1142 def update(self): … … 1262 1262 def label(self): 1263 1263 return '%s: Online Payment Ticket %s' % ( 1264 self.context.getStudent(). fullname,self.context.p_id)1264 self.context.getStudent().display_fullname,self.context.p_id) 1265 1265 1266 1266 class PaymentReceiptActionButton(ManageActionButton): … … 1384 1384 # @property 1385 1385 # def label(self): 1386 # return '%s: Accommodation Data' % self.context.__parent__. fullname1386 # return '%s: Accommodation Data' % self.context.__parent__.display_fullname 1387 1387 1388 1388 # This manage form page is for both students and students officers. … … 1401 1401 @property 1402 1402 def label(self): 1403 return '%s: Accommodation' % self.context.__parent__. fullname1403 return '%s: Accommodation' % self.context.__parent__.display_fullname 1404 1404 1405 1405 def update(self): … … 1681 1681 @property 1682 1682 def label(self): 1683 return '%s: History' % self.context. fullname1683 return '%s: History' % self.context.display_fullname 1684 1684 1685 1685 # Pages for students only -
main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/containermanagepage.pt
r7329 r7364 43 43 <span tal:content="item/student_id">A123456</span></a> 44 44 </td> 45 <td tal:content="item/ fullname">Bob</td>45 <td tal:content="item/display_fullname">Bob</td> 46 46 </tr> 47 47 </tbody> -
main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/containerpage.pt
r7205 r7364 45 45 <span tal:content="item/matric_number">9999999</span></a> 46 46 </td> 47 <td tal:content="item/ fullname">Bob</td>47 <td tal:content="item/display_fullname">Bob</td> 48 48 </tr> 49 49 </tbody> -
main/waeup.sirp/trunk/src/waeup/sirp/students/catalog.py
r7215 r7364 56 56 self.url = view.url(context) 57 57 self.student_id = context.student_id 58 self. fullname = context.fullname58 self.display_fullname = context.display_fullname 59 59 self.reg_number = context.reg_number 60 60 self.matric_number = context.matric_number -
main/waeup.sirp/trunk/src/waeup/sirp/students/interfaces.py
r7357 r7364 115 115 faccode = Attribute('The faculty code of any chosen study course') 116 116 current_session = Attribute('The current session of the student') 117 fullname = Attribute('The fullname of an applicant') 117 fullname = Attribute('All name parts separated by hyphens') 118 display_fullname = Attribute('The fullname of an applicant') 118 119 119 120 def loggerInfo(ob_class, comment): -
main/waeup.sirp/trunk/src/waeup/sirp/students/student.py
r7359 r7364 64 64 65 65 @property 66 def fullname(self):66 def display_fullname(self): 67 67 middlename = getattr(self, 'middlename', None) 68 68 sirp_utils = getUtility(ISIRPUtils) 69 69 return sirp_utils.fullname(self.firstname, self.lastname, middlename) 70 71 @property 72 def fullname(self): 73 middlename = getattr(self, 'middlename', None) 74 if middlename: 75 return '%s-%s-%s' % (self.firstname.lower(), 76 middlename.lower(), self.lastname.lower()) 77 else: 78 return '%s-%s' % (self.firstname.lower(), self.lastname.lower()) 70 79 71 80 @property -
main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_authentication.py
r7233 r7364 61 61 class FakeStudent(object): 62 62 student_id = 'test_stud' 63 fullname = 'Test User'63 display_fullname = 'Test User' 64 64 password = None 65 65 email = None -
main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_browser.py
r7357 r7364 279 279 self.assertTrue('Anna Tester' in self.browser.contents) 280 280 281 # We can find a student with a certain fullname281 # We can find a student by searching for all kind of name parts 282 282 self.browser.open(self.manage_container_path) 283 283 self.browser.getControl("Search").click() … … 285 285 self.browser.getControl(name="searchtype").value = ['fullname'] 286 286 self.browser.getControl(name="searchterm").value = 'Anna Tester' 287 self.browser.getControl("Search").click() 288 self.assertTrue('Anna Tester' in self.browser.contents) 289 self.browser.open(self.manage_container_path) 290 self.browser.getControl(name="searchtype").value = ['fullname'] 291 self.browser.getControl(name="searchterm").value = 'Anna' 292 self.browser.getControl("Search").click() 293 self.assertTrue('Anna Tester' in self.browser.contents) 294 self.browser.open(self.manage_container_path) 295 self.browser.getControl(name="searchtype").value = ['fullname'] 296 self.browser.getControl(name="searchterm").value = 'Tester' 297 self.browser.getControl("Search").click() 298 self.assertTrue('Anna Tester' in self.browser.contents) 299 self.browser.open(self.manage_container_path) 300 self.browser.getControl(name="searchtype").value = ['fullname'] 301 self.browser.getControl(name="searchterm").value = 'An' 302 self.browser.getControl("Search").click() 303 self.assertFalse('Anna Tester' in self.browser.contents) 304 self.browser.open(self.manage_container_path) 305 self.browser.getControl(name="searchtype").value = ['fullname'] 306 self.browser.getControl(name="searchterm").value = 'An*' 307 self.browser.getControl("Search").click() 308 self.assertTrue('Anna Tester' in self.browser.contents) 309 self.browser.open(self.manage_container_path) 310 self.browser.getControl(name="searchtype").value = ['fullname'] 311 self.browser.getControl(name="searchterm").value = 'tester' 312 self.browser.getControl("Search").click() 313 self.assertTrue('Anna Tester' in self.browser.contents) 314 self.browser.open(self.manage_container_path) 315 self.browser.getControl(name="searchtype").value = ['fullname'] 316 self.browser.getControl(name="searchterm").value = 'Tester Ana' 317 self.browser.getControl("Search").click() 318 self.assertFalse('Anna Tester' in self.browser.contents) 319 self.browser.open(self.manage_container_path) 320 self.browser.getControl(name="searchtype").value = ['fullname'] 321 self.browser.getControl(name="searchterm").value = 'Tester Anna' 287 322 self.browser.getControl("Search").click() 288 323 self.assertTrue('Anna Tester' in self.browser.contents) -
main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_student.py
r7351 r7364 39 39 super(StudentTest, self).setUp() 40 40 self.student = Student() 41 self.student.firstname = u'Anna' 42 self.student.lastname = u'Tester' 41 43 self.studycourse = StudentStudyCourse() 42 44 self.studylevel = StudentStudyLevel() -
main/waeup.sirp/trunk/src/waeup/sirp/utils/utils.py
r7359 r7364 20 20 import grok 21 21 import smtplib 22 from string import capwords 22 23 from email.mime.text import MIMEText 23 24 from waeup.sirp.interfaces import ISIRPUtils … … 57 58 # We do not necessarily have the middlename attribute 58 59 if middlename: 59 return '%s %s %s' % (firstname, middlename, lastname)60 return capwords('%s %s %s' % (firstname, middlename, lastname)) 60 61 else: 61 return '%s %s' % (firstname, lastname)62 return capwords('%s %s' % (firstname, lastname))
Note: See TracChangeset for help on using the changeset viewer.