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.
|
You more than likely will want to override this.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
fs = self.make_fieldset(obj)
|
return self.make_fieldset(obj)
|
||||||
return fs
|
|
||||||
|
|
||||||
def post_sync(self, fs):
|
def post_sync(self, fs):
|
||||||
pass
|
pass
|
||||||
|
|
|
@ -89,11 +89,15 @@ class Grid(object):
|
||||||
def grid_config(self, search, fmap):
|
def grid_config(self, search, fmap):
|
||||||
return self.make_grid_config(search, fmap)
|
return self.make_grid_config(search, fmap)
|
||||||
|
|
||||||
|
def filter_query(self, q):
|
||||||
|
return q
|
||||||
|
|
||||||
def make_query(self, config, jmap=None):
|
def make_query(self, config, jmap=None):
|
||||||
if jmap is None:
|
if jmap is None:
|
||||||
jmap = self.join_map()
|
jmap = self.join_map()
|
||||||
smap = self.sort_map()
|
smap = self.sort_map()
|
||||||
q = Session.query(self.mapped_class)
|
q = Session.query(self.mapped_class)
|
||||||
|
q = self.filter_query(q)
|
||||||
q = filters.filter_query(q, config, jmap)
|
q = filters.filter_query(q, config, jmap)
|
||||||
q = grids.sort_query(q, config, smap, jmap)
|
q = grids.sort_query(q, config, smap, jmap)
|
||||||
return q
|
return q
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue