[Erp5-report] r33162 seb - /erp5/trunk/products/ERP5Form/Form.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Mon Mar 1 09:01:58 CET 2010
Author: seb
Date: Mon Mar 1 09:01:54 2010
New Revision: 33162
URL: http://svn.erp5.org?rev=33162&view=rev
Log:
* your prefix should not be used any more on field libraries.
* start to take into account new guideline in the list
of proposed proxy fields. Keep code commented for now until
guideline is fully validated
Modified:
erp5/trunk/products/ERP5Form/Form.py
Modified: erp5/trunk/products/ERP5Form/Form.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Form/Form.py?rev=33162&r1=33161&r2=33162&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Form/Form.py [utf8] (original)
+++ erp5/trunk/products/ERP5Form/Form.py [utf8] Mon Mar 1 09:01:54 2010
@@ -49,6 +49,7 @@
from Products.ERP5Type.PsycoWrapper import psyco
import sys
+import re
_field_value_cache = {}
def purgeFieldValueCache():
@@ -785,7 +786,7 @@
""""""
def extract_keyword(name):
keyword_list = [i for i in name.split('_') if not i in \
- ('my', 'default', 'listbox')]
+ ('my', 'default', 'listbox', 'your')]
if len(keyword_list) == 0:
# This means that the name is one of the exception keywords,
# so we have to keep it
@@ -806,8 +807,13 @@
if field_object.aq_base is field.aq_base:
return 0
field_id = field_object.getId()
- if id_.startswith('my_') and not field_id.startswith('my_'):
- return 0
+ # All proxy fields in field libraries should define their
+ # technical context
+ # XXX Theses 3 following lines will need to be uncommented
+ # as soon as proxy guideline is fully validated on erp5_trade
+ #if field.meta_type == 'ProxyField' and \
+ # re.match('my_.*_mode', field_id) is None:
+ # return 0
# XXX keyword match is not useful anymore.Need different approach.
keyword_match_rate = check_keyword_list(field_id, extract_keyword(id_))
if keyword_match_rate>0.5:
More information about the Erp5-report
mailing list