[gen] Bugfixes.
This commit is contained in:
parent
8511c22612
commit
50bd996c3b
5 changed files with 17 additions and 8 deletions
|
@ -218,17 +218,17 @@ class ToolMixin(BaseMixin):
|
|||
- the number of columns for layouting those fields.'''
|
||||
fields = []
|
||||
if refInfo:
|
||||
# The search is triggered from a Ref field.
|
||||
# The search is triggered from a Ref field
|
||||
refObject, fieldName = self.getRefInfo(refInfo)
|
||||
refField = refObject.getAppyType(fieldName)
|
||||
fieldNames = refField.queryFields or ()
|
||||
nbOfColumns = refField.queryNbCols
|
||||
else:
|
||||
# The search is triggered from an app-wide search.
|
||||
# The search is triggered from an app-wide search
|
||||
klass = self.getAppyClass(className)
|
||||
fieldNames = getattr(klass, 'searchFields', None)
|
||||
if not fieldNames:
|
||||
# Gather all the indexed fields on this class.
|
||||
# Gather all the indexed fields on this class
|
||||
fieldNames = [f.name for f in self.getAllAppyTypes(className) \
|
||||
if f.indexed]
|
||||
nbOfColumns = getattr(klass, 'numberOfSearchColumns', 3)
|
||||
|
|
|
@ -550,7 +550,7 @@ class ToolWrapper(AbstractWrapper):
|
|||
layoutType='search';
|
||||
x=ztool.getCssJs(searchInfo.fields, 'edit', cssJs)">
|
||||
|
||||
<!-- Include type-specific CSS and JS. -->
|
||||
<!-- Include type-specific CSS and JS -->
|
||||
<link for="cssFile in cssJs['css']" rel="stylesheet" type="text/css"
|
||||
href=":url(cssFile)"/>
|
||||
<script for="jsFile in cssJs['js']" type="text/javascript"
|
||||
|
|
|
@ -1071,6 +1071,11 @@ class AbstractWrapper(object):
|
|||
indexes = []
|
||||
for name in fields:
|
||||
field = self.getField(name)
|
||||
if not field:
|
||||
# The index may be a standard Appy index that does not
|
||||
# correspond to a field.
|
||||
indexes.append(name)
|
||||
continue
|
||||
if not field.indexed: continue
|
||||
# A field may have 2 different indexes
|
||||
iName = field.getIndexName(usage='search')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue