From 0a1c4c37942e66274eba43349d23e6d165c21184 Mon Sep 17 00:00:00 2001 From: Kevin Deldycke <kevin@nexedi.com> Date: Thu, 24 Feb 2005 17:02:36 +0000 Subject: [PATCH] Clean setters an getters of the default career git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@2575 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ERP5/Document/Entity.py | 53 +++++++++++++++++++-------------- 1 file changed, 31 insertions(+), 22 deletions(-) diff --git a/product/ERP5/Document/Entity.py b/product/ERP5/Document/Entity.py index adf545ee19..3d84855712 100755 --- a/product/ERP5/Document/Entity.py +++ b/product/ERP5/Document/Entity.py @@ -91,8 +91,18 @@ class Entity: except: return '' - security.declareProtected(Permissions.View, 'getDefaultCollectiveAgreementTitle') - def getDefaultCollectiveAgreementTitle(self): + security.declareProtected(Permissions.View, 'getDefaultCareerDescription') + def getDefaultCareerDescription(self): + """ + Returns the default address city as a text string + """ + try: + return self.getDefaultCareerValue().getDescription() + except: + return '' + + security.declareProtected(Permissions.View, 'getDefaultCareerCollectiveAgreementTitle') + def getDefaultCareerCollectiveAgreementTitle(self): """ Returns the default address city as a text string """ @@ -131,16 +141,6 @@ class Entity: except: return None - security.declareProtected(Permissions.View, 'getDefaultCareerDescription') - def getDefaultCareerDescription(self): - """ - Returns the default address city as a text string - """ - try: - return self.getDefaultCareerValue().getDescription() - except: - return '' - security.declareProtected(Permissions.View, 'getDefaultCareerSalaryLevel') def getDefaultCareerSalaryLevel(self): """ @@ -247,6 +247,14 @@ class Entity: self._setDefaultCareerTitle(coordinate) self.reindexObject() + security.declareProtected(Permissions.ModifyPortalContent, 'setDefaultCareerDescription') + def setDefaultCareerDescription(self, coordinate): + """ + Updates the default address from a standard text string + """ + self._setDefaultCareerDescription(coordinate) + self.reindexObject() + security.declareProtected(Permissions.ModifyPortalContent, 'setDefaultCareerCollectiveAgreementTitle') def setDefaultCareerCollectiveAgreementTitle(self, coordinate): """ @@ -255,14 +263,6 @@ class Entity: self._setDefaultCareerCollectiveAgreementTitle(coordinate) self.reindexObject() - security.declareProtected(Permissions.ModifyPortalContent, 'setDefaultCareerDescription') - def setDefaultCareerDescription(self, coordinate): - """ - Updates the default address from a standard text string - """ - self._setDefaultCareerDescription(coordinate) - self.reindexObject() - security.declareProtected(Permissions.ModifyPortalContent, 'setDefaultCareerStartDate') def setDefaultCareerStartDate(self, coordinate): """ @@ -441,13 +441,22 @@ class Entity: security.declarePrivate('_setDefaultCareerDescription') def _setDefaultCareerDescription(self, coordinate): + assertAttributePortalType(self, 'default_career', 'Career') + if not hasattr(self,'default_career'): + self.invokeFactory( type_name='Career' + , id='default_career' + ) + self.default_career.setDescription(coordinate) + + security.declarePrivate('_setDefaultCareerCollectiveAgreementTitle') + def _setDefaultCareerCollectiveAgreementTitle(self, coordinate): assertAttributePortalType(self, 'default_career', 'Career') if not hasattr(self,'default_career'): self.invokeFactory( type_name='Career' , id='default_career' ) - self.default_career.setDescription(coordinate) - + self.default_career.setCollectiveAgreementTitle(coordinate) + security.declarePrivate('_setDefaultCareerStartDate') def _setDefaultCareerStartDate(self, coordinate): assertAttributePortalType(self, 'default_career', 'Career') -- 2.30.9