Add way for batch views to hide rows with given status code(s)
This seems like it would often be useful...though maybe belongs in the handler?
This commit is contained in:
parent
e452ea1ae9
commit
12545c6a20
|
@ -634,13 +634,19 @@ class BatchMasterView(MasterView):
|
|||
g.status_code.set(label="Status",
|
||||
renderer=StatusRenderer(self.model_row_class.STATUS))
|
||||
|
||||
|
||||
hide_row_status_codes = []
|
||||
|
||||
def get_row_data(self, batch):
|
||||
"""
|
||||
Generate the base data set for a rows grid.
|
||||
"""
|
||||
return self.Session.query(self.model_row_class)\
|
||||
.filter(self.model_row_class.batch == batch)\
|
||||
.filter(self.model_row_class.removed == False)
|
||||
query = self.Session.query(self.model_row_class)\
|
||||
.filter(self.model_row_class.batch == batch)\
|
||||
.filter(self.model_row_class.removed == False)
|
||||
if self.hide_row_status_codes:
|
||||
query = query.filter(~self.model_row_class.status_code.in_(self.hide_row_status_codes))
|
||||
return query
|
||||
|
||||
def row_editable(self, row):
|
||||
"""
|
||||
|
|
Loading…
Reference in a new issue