From 5f3b91826a3911aee376293ad0c9d13abcf7a3ed Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Fri, 17 May 2013 23:32:17 -0700 Subject: [PATCH] Added email address to vendor CRUD views. --- rattail/pyramid/views/vendors.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/rattail/pyramid/views/vendors.py b/rattail/pyramid/views/vendors.py index 730e39d2..97097a9e 100644 --- a/rattail/pyramid/views/vendors.py +++ b/rattail/pyramid/views/vendors.py @@ -84,6 +84,7 @@ class VendorCrud(CrudView): fs.id.label("ID"), fs.name, fs.special_discount, + fs.email.label("Email Address"), ]) return fs @@ -94,32 +95,31 @@ class VendorsAutocomplete(AutocompleteView): fieldname = 'name' -def includeme(config): - +def add_routes(config): config.add_route('vendors', '/vendors') + config.add_route('vendors.autocomplete', '/vendors/autocomplete') + config.add_route('vendor.create', '/vendors/new') + config.add_route('vendor.read', '/vendors/{uuid}') + config.add_route('vendor.update', '/vendors/{uuid}/edit') + config.add_route('vendor.delete', '/vendors/{uuid}/delete') + + +def includeme(config): + add_routes(config) + config.add_view(VendorsGrid, route_name='vendors', renderer='/vendors/index.mako', permission='vendors.list') - - config.add_route('vendors.autocomplete', '/vendors/autocomplete') config.add_view(VendorsAutocomplete, route_name='vendors.autocomplete', renderer='json', permission='vendors.list') - - config.add_route('vendor.create', '/vendors/new') config.add_view(VendorCrud, attr='create', route_name='vendor.create', renderer='/vendors/crud.mako', permission='vendors.create') - - config.add_route('vendor.read', '/vendors/{uuid}') config.add_view(VendorCrud, attr='read', route_name='vendor.read', renderer='/vendors/crud.mako', permission='vendors.read') - - config.add_route('vendor.update', '/vendors/{uuid}/edit') config.add_view(VendorCrud, attr='update', route_name='vendor.update', renderer='/vendors/crud.mako', permission='vendors.update') - - config.add_route('vendor.delete', '/vendors/{uuid}/delete') config.add_view(VendorCrud, attr='delete', route_name='vendor.delete', permission='vendors.delete')