From a81e121ffd53d7d1ee0a5be30d0e9c886fbd1417 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Wed, 22 Feb 2023 22:41:12 -0600 Subject: [PATCH] Allow sort/filter by vendor for sample files grid --- tailbone/views/vendors/samplefiles.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tailbone/views/vendors/samplefiles.py b/tailbone/views/vendors/samplefiles.py index 41982259..a75bc1fb 100644 --- a/tailbone/views/vendors/samplefiles.py +++ b/tailbone/views/vendors/samplefiles.py @@ -61,8 +61,13 @@ class VendorSampleFileView(MasterView): def configure_grid(self, g): super(VendorSampleFileView, self).configure_grid(g) + model = self.model # vendor + g.set_joiner('vendor', lambda q: q.join(model.Vendor)) + g.set_sorter('vendor', model.Vendor.name) + g.set_filter('vendor', model.Vendor.name, + default_active=True, default_verb='contains') g.set_link('vendor') # filename