Back to index

plone3  3.1.7
Public Member Functions | Static Public Attributes | Static Private Attributes
ATReferenceBrowserWidget.ATReferenceBrowserWidget.ReferenceBrowserWidget Class Reference
Inheritance diagram for ATReferenceBrowserWidget.ATReferenceBrowserWidget.ReferenceBrowserWidget:
Inheritance graph
[legend]
Collaboration diagram for ATReferenceBrowserWidget.ATReferenceBrowserWidget.ReferenceBrowserWidget:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def getBaseQuery
def getStartupDirectory

Static Public Attributes

tuple security = ClassSecurityInfo()

Static Private Attributes

tuple _properties = ReferenceWidget._properties.copy()

Detailed Description

Definition at line 11 of file ATReferenceBrowserWidget.py.


Member Function Documentation

Return base query to use for content search

Definition at line 63 of file ATReferenceBrowserWidget.py.

00063 
00064     def getBaseQuery(self, instance, field):
00065         """Return base query to use for content search"""
00066 
00067         query = self.base_query
00068         if query:
00069             if type(query) is StringType and shasattr(instance, query):
00070                 method = getattr(instance, query)
00071                 results = method()
00072             elif callable(query):
00073                 results = query()
00074             elif isinstance(query,dict):
00075                 results = query
00076         else:
00077             results = {}
00078 
00079         # Add portal type restrictions based on settings in field, if not part
00080         # of original base_query the template tries to do this, but ignores
00081         # allowed_types_method, which should override allowed_types
00082         if not results.has_key('portal_type'):
00083             allowed_types = getattr(field, 'allowed_types', ())
00084             allow_method = getattr(field, 'allowed_types_method', None)
00085             if allow_method is not None:
00086                 meth = getattr(instance, allow_method)
00087                 allowed_types = meth()
00088             results['portal_type']=allowed_types
00089 
00090         return results

Here is the call graph for this function:

Return the path to the startup directory. 

Definition at line 91 of file ATReferenceBrowserWidget.py.

00091 
00092     def getStartupDirectory(self, instance):
00093         """ Return the path to the startup directory. """
00094         if self.startup_directory_method:
00095             if getattr(aq_base(instance), self.startup_directory_method, False):
00096                 method = getattr(instance, self.startup_directory_method)
00097                 if callable(method):
00098                     return method()
00099                 return method
00100         return self.startup_directory
00101 
00102 
00103 registerWidget(ReferenceBrowserWidget,
00104                title='Reference Browser',
00105                description=('Reference widget that allows you to browse or search the portal for objects to refer to.'),
00106                used_for=('Products.Archetypes.Field.ReferenceField',)
00107                )
00108 
00109 registerPropertyType('default_search_index', 'string', ReferenceBrowserWidget)
00110 registerPropertyType('show_index_selector', 'boolean', ReferenceBrowserWidget)
00111 registerPropertyType('available_indexes', 'dictionary', ReferenceBrowserWidget)
00112 registerPropertyType('allow_search', 'boolean', ReferenceBrowserWidget)
00113 registerPropertyType('allow_browse', 'boolean', ReferenceBrowserWidget)
00114 registerPropertyType('startup_directory', 'string', ReferenceBrowserWidget)
00115 registerPropertyType('restrict_browsing_to_startup_directory', 'boolean', ReferenceBrowserWidget)
00116 registerPropertyType('search_catalog', 'string', ReferenceBrowserWidget)
00117 registerPropertyType('image_portal_types', 'lines', ReferenceBrowserWidget)
00118 registerPropertyType('image_method', 'string', ReferenceBrowserWidget)
00119 registerPropertyType('force_close_on_insert', 'boolean', ReferenceBrowserWidget)

Here is the call graph for this function:


Member Data Documentation

tuple ATReferenceBrowserWidget.ATReferenceBrowserWidget.ReferenceBrowserWidget._properties = ReferenceWidget._properties.copy() [static, private]

Definition at line 12 of file ATReferenceBrowserWidget.py.

Definition at line 60 of file ATReferenceBrowserWidget.py.


The documentation for this class was generated from the following file: