add filter_query() to Grid view
This commit is contained in:
parent
f0c8858fb0
commit
4df92ee794
2 changed files with 5 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue