[gen] More work on Ref.link='popup'.

This commit is contained in:
Gaetan Delannay 2014-07-23 22:29:47 +02:00
parent 792db32f27
commit a14bff45a7
4 changed files with 183 additions and 60 deletions

View file

@ -356,7 +356,7 @@ class ToolMixin(BaseMixin):
brains = self.getPath("/catalog")(**params)
if brainsOnly:
# Return brains only.
if not maxResults: return brains
if not maxResults or (maxResults == 'NO_LIMIT'): return brains
else: return brains[:maxResults]
if not maxResults:
if refField: maxResults = refField.maxPerPage
@ -731,8 +731,8 @@ class ToolMixin(BaseMixin):
res = Search('customSearch', **fields)
elif ':' in name:
# The search is defined in a Ref field with link=popup
refClass, ref = name.split(':')
res = getattr(self.getAppyClass(refClass), ref).select
refObject, ref = name.split(':')
res = getattr(self.getObject(refObject,appy=True).klass,ref).select
elif name:
appyClass = self.getAppyClass(className)
# Search among static searches