From 2d71669c10d391bf367b9c682c8c590d6c6d72a0 Mon Sep 17 00:00:00 2001 From: Nicolas Delaby <nicolas@nexedi.com> Date: Thu, 11 Mar 2010 13:26:24 +0000 Subject: [PATCH] I miss one optimisation here. Use _getOb instead of getattr twice. Thanks Julien for the tips git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@33643 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ERP5Form/ProxyField.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/product/ERP5Form/ProxyField.py b/product/ERP5Form/ProxyField.py index 9728044d4a..8cbae6cc4d 100644 --- a/product/ERP5Form/ProxyField.py +++ b/product/ERP5Form/ProxyField.py @@ -448,10 +448,8 @@ class ProxyField(ZMIField): if (proxy_form is not None): field_id = self.get_value('field_id') - proxy_field = getattr(aq_base(proxy_form), field_id, None) - if proxy_field is not None: - proxy_field = getattr(proxy_form, field_id) - else: + proxy_field = proxy_form._getOb(field_id, None) + if proxy_field is None: if form_id_with_skin_folder_name_flag is False: # Try to get the field from another field library with a lower # priority. -- 2.30.9