Commit 07840990 authored by Yusei Tahara's avatar Yusei Tahara

support to search talesfield and methodfield.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@18041 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 11b54990
...@@ -25,6 +25,8 @@ from Products.Formulator.Field import Field ...@@ -25,6 +25,8 @@ from Products.Formulator.Field import Field
from Products.Formulator.Widget import Widget from Products.Formulator.Widget import Widget
from Products.Formulator.Widget import render_element from Products.Formulator.Widget import render_element
from Products.Formulator.FieldRegistry import FieldRegistry from Products.Formulator.FieldRegistry import FieldRegistry
from Products.Formulator import TALESField
from Products.Formulator import MethodField
from ProxyField import ProxyField from ProxyField import ProxyField
from AccessControl import ClassSecurityInfo from AccessControl import ClassSecurityInfo
from cgi import escape from cgi import escape
...@@ -1467,7 +1469,15 @@ Field.render_dict = Field_render_dict ...@@ -1467,7 +1469,15 @@ Field.render_dict = Field_render_dict
# Find support in ZMI. This is useful for development. # Find support in ZMI. This is useful for development.
def getSearchSource(obj):
obj_type = type(obj)
if obj_type is MethodField.Method:
return obj.method_name
elif obj_type is TALESField.TALESMethod:
return obj._text
return str(obj)
def Field_PrincipiaSearchSource(self): def Field_PrincipiaSearchSource(self):
return str((self.values.values(), self.tales.values(), return ''.join(
self.overrides.values())) map(getSearchSource,
(self.values.values()+self.tales.values()+self.overrides.values())))
Field.PrincipiaSearchSource = Field_PrincipiaSearchSource Field.PrincipiaSearchSource = Field_PrincipiaSearchSource
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