[Erp5-report] r10080 - /erp5/trunk/products/ERP5/Document/Telephone.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Mon Sep 18 11:46:09 CEST 2006
Author: romain
Date: Mon Sep 18 11:46:08 2006
New Revision: 10080
URL: http://svn.erp5.org?rev=10080&view=rev
Log:
Use accessors to get properties.
Test None value with the 'is' keyword.
Modified:
erp5/trunk/products/ERP5/Document/Telephone.py
Modified: erp5/trunk/products/ERP5/Document/Telephone.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/Telephone.py?rev=10080&r1=10079&r2=10080&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/Telephone.py (original)
+++ erp5/trunk/products/ERP5/Document/Telephone.py Mon Sep 18 11:46:08 2006
@@ -98,19 +98,25 @@
script = self._getTypeBasedMethod('asText')
if script is not None:
return script()
+
text = '+'
- if self.telephone_country != None:
- text += self.telephone_country
+ telephone_country = self.getTelephoneCountry()
+ if telephone_country is not None:
+ text += telephone_country
+
text += '(0)'
- if self.telephone_area != None:
- text += self.telephone_area
+ telephone_area = self.getTelephoneArea()
+ if telephone_area is not None:
+ text += telephone_area
+
text += '-'
- if self.telephone_number != None:
- text += self.telephone_number
- if text == '+(0)-' :
- return ''
- else:
- return text
+ telephone_number = self.getTelephoneNumber()
+ if self.telephone_number is not None:
+ text += telephone_number
+
+ if text == '+(0)-':
+ text = ''
+ return text
security.declareProtected(Permissions.View, 'getText')
getText = asText
More information about the Erp5-report
mailing list