[gen] Search: bugfix in filtered unnamed searches.
This commit is contained in:
		
							parent
							
								
									5c6952537e
								
							
						
					
					
						commit
						4d154c314f
					
				
					 3 changed files with 8 additions and 8 deletions
				
			
		| 
						 | 
				
			
			@ -9,7 +9,7 @@ from appy.shared.utils import sequenceTypes
 | 
			
		|||
 | 
			
		||||
# ------------------------------------------------------------------------------
 | 
			
		||||
class MailConfig:
 | 
			
		||||
    '''Parameters for conneting to a SMTP server.'''
 | 
			
		||||
    '''Parameters for conneting to a SMTP server'''
 | 
			
		||||
    def __init__(self, fromName=None, fromEmail='info@appyframework.org',
 | 
			
		||||
                 server='localhost', port=25, login=None, password=None,
 | 
			
		||||
                 enabled=True):
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -504,7 +504,7 @@ class ToolMixin(BaseMixin):
 | 
			
		|||
 | 
			
		||||
           If p_klass does not define this attr "creators", we will use a
 | 
			
		||||
           default list of roles as defined in the config.'''
 | 
			
		||||
        # Get the value of attr "creators", or a default value if not present.
 | 
			
		||||
        # Get the value of attr "creators", or a default value if not present
 | 
			
		||||
        if hasattr(klass, 'creators'):
 | 
			
		||||
            creators = klass.creators
 | 
			
		||||
        else:
 | 
			
		||||
| 
						 | 
				
			
			@ -741,6 +741,9 @@ class ToolMixin(BaseMixin):
 | 
			
		|||
            # It is a custom search whose parameters are in the session
 | 
			
		||||
            fields = self.REQUEST.SESSION['searchCriteria']
 | 
			
		||||
            res = Search('customSearch', **fields)
 | 
			
		||||
        elif (name == 'allSearch') or not name:
 | 
			
		||||
            # It is the search for every instance of p_className
 | 
			
		||||
            res = Search('allSearch')            
 | 
			
		||||
        elif '*' in name:
 | 
			
		||||
            # The search is defined in a Ref field with link=popup. Get the
 | 
			
		||||
            # search, the initiator object and the Ref field.
 | 
			
		||||
| 
						 | 
				
			
			@ -748,7 +751,7 @@ class ToolMixin(BaseMixin):
 | 
			
		|||
            initiator = self.getObject(uid, appy=True)
 | 
			
		||||
            initiatorField = initiator.getField(ref)
 | 
			
		||||
            res = getattr(initiator.klass, ref).select
 | 
			
		||||
        elif name:
 | 
			
		||||
        else:
 | 
			
		||||
            appyClass = self.getAppyClass(className)
 | 
			
		||||
            # Search among static searches
 | 
			
		||||
            res = ClassDescriptor.getSearch(appyClass, name)
 | 
			
		||||
| 
						 | 
				
			
			@ -758,9 +761,6 @@ class ToolMixin(BaseMixin):
 | 
			
		|||
                    if search.name == name:
 | 
			
		||||
                        res = search
 | 
			
		||||
                        break
 | 
			
		||||
        else:
 | 
			
		||||
            # It is the search for every instance of p_className
 | 
			
		||||
            res = Search('allSearch')
 | 
			
		||||
        # Return a UiSearch if required
 | 
			
		||||
        if ui:
 | 
			
		||||
            res = UiSearch(res, className, self)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -484,12 +484,12 @@ class ToolWrapper(AbstractWrapper):
 | 
			
		|||
                app.config.reindex()
 | 
			
		||||
            except:
 | 
			
		||||
                failed.append(app.config)
 | 
			
		||||
            # Then, refresh objects in the "data" folder.
 | 
			
		||||
            # Then, refresh objects in the "data" folder
 | 
			
		||||
            for obj in app.data.objectValues():
 | 
			
		||||
                subNb, subFailed = self.refreshCatalog(startObject=obj)
 | 
			
		||||
                nb += subNb
 | 
			
		||||
                failed += subFailed
 | 
			
		||||
            # Re-try to index all objects for which reindexation has failed.
 | 
			
		||||
            # Re-try to index all objects for which reindexation has failed
 | 
			
		||||
            for obj in failed: obj.reindex()
 | 
			
		||||
            if failed:
 | 
			
		||||
                failMsg = ' (%d retried)' % len(failed)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue