Changeset 7359
- Timestamp:
- 16 Dec 2011, 07:32:42 (13 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/applicants/applicant.py
r7356 r7359 19 19 import grok 20 20 from grok import index 21 from zope.component import getUtility 21 22 from zope.component.interfaces import IFactory 22 23 from zope.component import createObject, getUtility … … 29 30 from waeup.sirp.imagestorage import DefaultFileStoreHandler 30 31 from waeup.sirp.interfaces import ( 31 IObjectHistory, IFileStoreHandler, IFileStoreNameChooser )32 IObjectHistory, IFileStoreHandler, IFileStoreNameChooser, ISIRPUtils) 32 33 from waeup.sirp.utils.helpers import attrs_to_fields, get_current_principal 33 34 from waeup.sirp.applicants.interfaces import ( … … 71 72 @property 72 73 def fullname(self): 73 # We do not necessarily have the middlename attribute74 74 middlename = getattr(self, 'middlename', None) 75 if middlename: 76 return '%s %s %s' % (self.firstname, 77 middlename, self.lastname) 78 else: 79 return '%s %s' % (self.firstname, self.lastname) 75 sirp_utils = getUtility(ISIRPUtils) 76 return sirp_utils.fullname(self.firstname, self.lastname, middlename) 80 77 81 78 def createStudent(self): -
main/waeup.sirp/trunk/src/waeup/sirp/students/student.py
r7357 r7359 21 21 import os 22 22 import grok 23 from zope.component import getUtility 23 24 from zope.component.interfaces import IFactory 24 25 from zope.interface import implementedBy … … 26 27 from zope.securitypolicy.interfaces import IPrincipalRoleManager 27 28 from waeup.sirp.interfaces import ( 28 IObjectHistory, IUserAccount, IFileStoreNameChooser, IFileStoreHandler) 29 IObjectHistory, IUserAccount, IFileStoreNameChooser, IFileStoreHandler, 30 ISIRPUtils) 29 31 from waeup.sirp.image import SIRPImageFile 30 32 from waeup.sirp.imagestorage import DefaultFileStoreHandler … … 63 65 @property 64 66 def fullname(self): 65 # We do not necessarily have the middlename attribute66 67 middlename = getattr(self, 'middlename', None) 67 if middlename: 68 return '%s %s %s' % (self.firstname, 69 middlename, self.lastname) 70 else: 71 return '%s %s' % (self.firstname, self.lastname) 68 sirp_utils = getUtility(ISIRPUtils) 69 return sirp_utils.fullname(self.firstname, self.lastname, middlename) 72 70 73 71 @property -
main/waeup.sirp/trunk/src/waeup/sirp/utils/helpers.py
r7358 r7359 23 23 import shutil 24 24 import grok 25 import smtplib26 from email.mime.text import MIMEText27 25 from cStringIO import StringIO 28 26 from docutils.core import publish_string -
main/waeup.sirp/trunk/src/waeup/sirp/utils/utils.py
r7358 r7359 53 53 server.quit() 54 54 return True 55 56 def fullname(self,firstname,lastname,middlename=None): 57 # We do not necessarily have the middlename attribute 58 if middlename: 59 return '%s %s %s' % (firstname, middlename, lastname) 60 else: 61 return '%s %s' % (firstname, lastname)
Note: See TracChangeset for help on using the changeset viewer.