From e5c3dc0c3e8d571f20f6543233af2c209d074b62 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Fri, 10 Aug 2012 14:56:33 -0700 Subject: [PATCH] tweak some stuff --- rattail/pyramid/templates/reports/ordering.mako | 4 ++-- rattail/pyramid/views/customers.py | 5 ++--- rattail/pyramid/views/products.py | 6 ++---- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/rattail/pyramid/templates/reports/ordering.mako b/rattail/pyramid/templates/reports/ordering.mako index 6a02a45a..2eca252f 100644 --- a/rattail/pyramid/templates/reports/ordering.mako +++ b/rattail/pyramid/templates/reports/ordering.mako @@ -19,7 +19,7 @@ ${h.form(request.current_route_url())} ${h.hidden('departments', value='')} -
+
${h.hidden('vendor', value='')} ${h.text('vendor-name', size='40', value='')} @@ -29,7 +29,7 @@ ${h.hidden('departments', value='')}
-
+
diff --git a/rattail/pyramid/views/customers.py b/rattail/pyramid/views/customers.py index c3365790..c1d61470 100644 --- a/rattail/pyramid/views/customers.py +++ b/rattail/pyramid/views/customers.py @@ -88,9 +88,8 @@ class CustomersGrid(SearchableAlchemyGridView): ], readonly=True) - def attrs(row, i): - return {'onclick': "location.href = '%s';" - % self.request.route_url('customer.read', uuid=row.uuid)} + g.row_route_name = 'customer.read' + g.row_route_kwargs = lambda x: {'uuid': x.uuid} g.row_attrs = attrs return g diff --git a/rattail/pyramid/views/products.py b/rattail/pyramid/views/products.py index 777a9fcf..8c354779 100644 --- a/rattail/pyramid/views/products.py +++ b/rattail/pyramid/views/products.py @@ -123,10 +123,8 @@ class ProductsGrid(SearchableAlchemyGridView): ], readonly=True) - def attrs(row, i): - return {'onclick': "location.href = '%s';" - % self.request.route_url('product.read', uuid=row.uuid)} - g.row_attrs = attrs + g.row_route_name = 'product.read' + g.row_route_kwargs = lambda x: {'uuid': x.uuid} if edbob.config.getboolean('rattail.labels', 'enabled', default=False): def labels(row):