add filter_*, sorter methods to *AlchemyGridView
This commit is contained in:
		
							parent
							
								
									706931776e
								
							
						
					
					
						commit
						f678d10187
					
				
					 1 changed files with 9 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -71,6 +71,9 @@ class SortableAlchemyGridView(AlchemyGridView):
 | 
			
		|||
        return grids.util.get_sort_map(
 | 
			
		||||
            self.mapped_class, names=args or None, **kwargs)
 | 
			
		||||
 | 
			
		||||
    def sorter(self, field):
 | 
			
		||||
        return grids.util.sorter(field)
 | 
			
		||||
 | 
			
		||||
    def sort_map(self):
 | 
			
		||||
        return self.make_sort_map()
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -127,6 +130,12 @@ class PagedAlchemyGridView(SortableAlchemyGridView):
 | 
			
		|||
 | 
			
		||||
class SearchableAlchemyGridView(PagedAlchemyGridView):
 | 
			
		||||
 | 
			
		||||
    def filter_exact(self, field):
 | 
			
		||||
        return grids.search.filter_exact(field)
 | 
			
		||||
 | 
			
		||||
    def filter_ilike(self, field):
 | 
			
		||||
        return grids.search.filter_ilike(field)
 | 
			
		||||
 | 
			
		||||
    def make_filter_map(self, **kwargs):
 | 
			
		||||
        return grids.search.get_filter_map(self.mapped_class, **kwargs)
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue