Commit 13de2c96 authored by Sebastien Robin's avatar Sebastien Robin

* 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

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@33162 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 323e4951
...@@ -49,6 +49,7 @@ from Products.ERP5Type.Utils import UpperCase ...@@ -49,6 +49,7 @@ from Products.ERP5Type.Utils import UpperCase
from Products.ERP5Type.PsycoWrapper import psyco from Products.ERP5Type.PsycoWrapper import psyco
import sys import sys
import re
_field_value_cache = {} _field_value_cache = {}
def purgeFieldValueCache(): def purgeFieldValueCache():
...@@ -785,7 +786,7 @@ class ERP5Form(ZMIForm, ZopePageTemplate): ...@@ -785,7 +786,7 @@ class ERP5Form(ZMIForm, ZopePageTemplate):
"""""" """"""
def extract_keyword(name): def extract_keyword(name):
keyword_list = [i for i in name.split('_') if not i in \ keyword_list = [i for i in name.split('_') if not i in \
('my', 'default', 'listbox')] ('my', 'default', 'listbox', 'your')]
if len(keyword_list) == 0: if len(keyword_list) == 0:
# This means that the name is one of the exception keywords, # This means that the name is one of the exception keywords,
# so we have to keep it # so we have to keep it
...@@ -806,8 +807,13 @@ class ERP5Form(ZMIForm, ZopePageTemplate): ...@@ -806,8 +807,13 @@ class ERP5Form(ZMIForm, ZopePageTemplate):
if field_object.aq_base is field.aq_base: if field_object.aq_base is field.aq_base:
return 0 return 0
field_id = field_object.getId() field_id = field_object.getId()
if id_.startswith('my_') and not field_id.startswith('my_'): # All proxy fields in field libraries should define their
return 0 # 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. # XXX keyword match is not useful anymore.Need different approach.
keyword_match_rate = check_keyword_list(field_id, extract_keyword(id_)) keyword_match_rate = check_keyword_list(field_id, extract_keyword(id_))
if keyword_match_rate>0.5: if keyword_match_rate>0.5:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment