From 700584a08478eb9208c5b8fb4dfd85c7d68d79ad Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Tue, 31 Mar 2020 14:13:02 -0500 Subject: [PATCH] Fix handling of `Vendor.id` field since that is really a "synonym" we must be explicit about it (for now..?) --- tailbone_corepos/views/corepos/vendors.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tailbone_corepos/views/corepos/vendors.py b/tailbone_corepos/views/corepos/vendors.py index dbcb273..c97f2fb 100644 --- a/tailbone_corepos/views/corepos/vendors.py +++ b/tailbone_corepos/views/corepos/vendors.py @@ -34,6 +34,7 @@ class VendorView(CoreOfficeMasterView): Base class for vendor views. """ model_class = corepos.Vendor + model_key = 'id' model_title = "CORE-POS Vendor" url_prefix = '/core-pos/vendors' route_prefix = 'corepos.vendors' @@ -68,10 +69,17 @@ class VendorView(CoreOfficeMasterView): def configure_grid(self, g): super(VendorView, self).configure_grid(g) + # TODO: this is only needed b/c of orm.synonym usage + g.set_sorter('id', corepos.Vendor.id) + g.set_link('id') g.set_link('name') g.set_link('abbreviation') + # TODO: ugh, would be nice to not have to do this... + def get_action_route_kwargs(self, row): + return {'id': row.id} + def configure_form(self, f): super(VendorView, self).configure_form(f)