add filter_query() to Grid view

This commit is contained in:
Lance Edgar 2012-07-11 01:30:43 -05:00
parent f0c8858fb0
commit 4df92ee794
2 changed files with 5 additions and 2 deletions

View file

@ -92,8 +92,7 @@ class Crud(object):
You more than likely will want to override this.
"""
fs = self.make_fieldset(obj)
return fs
return self.make_fieldset(obj)
def post_sync(self, fs):
pass

View file

@ -89,11 +89,15 @@ class Grid(object):
def grid_config(self, search, fmap):
return self.make_grid_config(search, fmap)
def filter_query(self, q):
return q
def make_query(self, config, jmap=None):
if jmap is None:
jmap = self.join_map()
smap = self.sort_map()
q = Session.query(self.mapped_class)
q = self.filter_query(q)
q = filters.filter_query(q, config, jmap)
q = grids.sort_query(q, config, smap, jmap)
return q