From 75c24b3733dffeabadeb3b7679e2ba04048582d4 Mon Sep 17 00:00:00 2001 From: Mayoro Diagne <mayoro@nexedi.com> Date: Mon, 22 Sep 2008 13:06:52 +0000 Subject: [PATCH] - using existing functions instead of attributes with getattr git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@23739 20353a03-c40f-0410-a6d1-a30d3c3de9de --- .../BaseCategoryDocumentationHelper.py | 24 ++++--------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/product/ERP5Type/DocumentationHelper/BaseCategoryDocumentationHelper.py b/product/ERP5Type/DocumentationHelper/BaseCategoryDocumentationHelper.py index c82c86d454..a7d5e71581 100644 --- a/product/ERP5Type/DocumentationHelper/BaseCategoryDocumentationHelper.py +++ b/product/ERP5Type/DocumentationHelper/BaseCategoryDocumentationHelper.py @@ -75,44 +75,28 @@ class BaseCategoryDocumentationHelper(DocumentationHelper): """ Returns the value of acquisition append value of the documented base category """ - value = getattr(self.getInstance(), 'acquisition_append_value', '') - if value: - return 'True' - else: - return 'False' + return self.getInstance().getAcquisitionAppendValue() and 'True' or 'False' security.declareProtected(Permissions.AccessContentsInformation, 'getAcquisitionMaskValue') def getAcquisitionMaskValue(self): """ Returns the value of acquisition mask value of the documented base category """ - value = getattr(self.getInstance(), 'acquisition_mask_value', '') - if value: - return 'True' - else: - return 'False' + return self.getInstance().getAcquisitionMaskValue() and 'True' or 'False' security.declareProtected(Permissions.AccessContentsInformation, 'getAcquisitionCopyValue') def getAcquisitionCopyValue(self): """ Returns the value of acquisition copy value of the documented base category """ - value = getattr(self.getInstance(), 'acquisition_copy_value', '') - if value: - return 'True' - else: - return 'False' + return self.getInstance().getAcquisitionCopyValue() and 'True' or 'False' security.declareProtected(Permissions.AccessContentsInformation, 'getAcquisitionSyncValue') def getAcquisitionSyncValue(self): """ Returns the value of acquisition sync value of the documented base category """ - value = getattr(self.getInstance(), 'acquisition_sync_value', '') - if value: - return 'True' - else: - return 'False' + return self.getInstance().getAcquisitionSyncValue() and 'True' or 'False' security.declareProtected(Permissions.AccessContentsInformation, 'getAcquisitionBaseCategoryList') def getAcquisitionBaseCategoryList(self): -- 2.30.9