[gen] Bugfixes and use of Ref.autoref fto avoid circular references within cross-class Ref fields.
This commit is contained in:
parent
e1b6b1b951
commit
ef21375410
4 changed files with 60 additions and 30 deletions
|
@ -324,7 +324,6 @@ class ToolMixin(BaseMixin):
|
|||
|
||||
If p_refObject and p_refField are given, the query is limited to the
|
||||
objects that are referenced from p_refObject through p_refField.'''
|
||||
|
||||
params = {'ClassName': className}
|
||||
appyClass = self.getAppyClass(className, wrapper=True)
|
||||
if not brainsOnly: params['batch'] = True
|
||||
|
|
|
@ -874,19 +874,22 @@ class AbstractWrapper(object):
|
|||
replaced with normal chars.'''
|
||||
return normalizeString(s, usage)
|
||||
|
||||
def search(self, klass, sortBy='', maxResults=None, noSecurity=False,
|
||||
**fields):
|
||||
def search(self, klass, sortBy='', sortOrder='asc', maxResults=None,
|
||||
noSecurity=False, **fields):
|
||||
'''Searches objects of p_klass. p_sortBy must be the name of an indexed
|
||||
field (declared with indexed=True); every param in p_fields must
|
||||
take the name of an indexed field and take a possible value of this
|
||||
field. You can optionally specify a maximum number of results in
|
||||
p_maxResults. If p_noSecurity is specified, you get all objects,
|
||||
even if the logged user does not have the permission to view it.'''
|
||||
field (declared with indexed=True); p_sortOrder can be "asc"
|
||||
(ascending, the defaut) or "desc" (descending); every param in
|
||||
p_fields must take the name of an indexed field and take a possible
|
||||
value of this field. You can optionally specify a maximum number of
|
||||
results in p_maxResults. If p_noSecurity is specified, you get all
|
||||
objects, even if the logged user does not have the permission to
|
||||
view it.'''
|
||||
# Find the content type corresponding to p_klass
|
||||
tool = self.tool.o
|
||||
contentType = tool.getPortalType(klass)
|
||||
# Create the Search object
|
||||
search = Search('customSearch', sortBy=sortBy, **fields)
|
||||
search = Search('customSearch', sortBy=sortBy, sortOrder=sortOrder,
|
||||
**fields)
|
||||
if not maxResults:
|
||||
maxResults = 'NO_LIMIT'
|
||||
# If I let maxResults=None, only a subset of the results will be
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue