diff --git a/pyalchemybiz/config/routing.py b/pyalchemybiz/config/routing.py index 53281bf..77493f2 100644 --- a/pyalchemybiz/config/routing.py +++ b/pyalchemybiz/config/routing.py @@ -10,7 +10,7 @@ from routes import Mapper def make_map(): """Create, configure and return the routes Mapper""" map = Mapper(directory=config['pylons.paths']['controllers'], - always_scan=config['debug']) + always_scan=config['debug'], explicit = True) map.minimization = False # The ErrorController route (handles 404/500 error pages); it should diff --git a/pyalchemybiz/controllers/customer.py b/pyalchemybiz/controllers/customer.py index b0de99a..39df665 100644 --- a/pyalchemybiz/controllers/customer.py +++ b/pyalchemybiz/controllers/customer.py @@ -93,7 +93,7 @@ class CustomerController(BaseController): meta.Session.delete(cust) meta.Session.commit() - redirect_to(action='list', id=None) + redirect_to(controller='customer', action='list') @restrict('POST') @validate(schema=NewCustomerForm(), form='new') @@ -110,7 +110,7 @@ class CustomerController(BaseController): meta.Session.add(cust.person) meta.Session.commit() - redirect_to(action='list', id=None) + redirect_to(controller='customer', action='list') @restrict('POST') @validate(schema=NewCustomerForm(), form='edit') @@ -129,4 +129,4 @@ class CustomerController(BaseController): meta.Session.add(cust.person) meta.Session.commit() - redirect_to(action='list', id=None) + redirect_to(controller='customer', action='list') diff --git a/pyalchemybiz/templates/derived/customer/edit.mako b/pyalchemybiz/templates/derived/customer/edit.mako index 4a776ad..493a472 100644 --- a/pyalchemybiz/templates/derived/customer/edit.mako +++ b/pyalchemybiz/templates/derived/customer/edit.mako @@ -1,6 +1,6 @@ <%inherit file="/base/customer.mako" /> <%namespace file="fields.mako" name="fields" import="*"/> -${h.form(h.url_for(action='save'))} +${h.form(h.url_for(controller='customer', action='save', id=c.id))}
${_('Edit customer')} ${fields.body()} diff --git a/pyalchemybiz/templates/derived/customer/new.mako b/pyalchemybiz/templates/derived/customer/new.mako index 22c622a..531e4b6 100644 --- a/pyalchemybiz/templates/derived/customer/new.mako +++ b/pyalchemybiz/templates/derived/customer/new.mako @@ -1,6 +1,6 @@ <%inherit file="/base/customer.mako" /> <%namespace file="fields.mako" name="fields" import="*"/> -${h.form(h.url_for(action='create'))} +${h.form(h.url_for(controller='customer', action='create'))}
${_('Create new customer')} ${fields.body()} diff --git a/pyalchemybiz/templates/derived/customer/view.mako b/pyalchemybiz/templates/derived/customer/view.mako index ac8f6d2..dbf062d 100644 --- a/pyalchemybiz/templates/derived/customer/view.mako +++ b/pyalchemybiz/templates/derived/customer/view.mako @@ -15,10 +15,10 @@ <%def name="footer()">

- ${h.link_to(_('All Customers'), h.url_for(controller='customer', action='list', id=None))} -| ${h.link_to(_('New Customer'), h.url_for(controller='customer', action='new', id=None))} -| ${h.link_to(_('Edit Customer'), h.url_for(controller='customer', action='edit'))} -| ${h.link_to(_('Delete Customer'), h.url_for(controller='customer', action='delete'))} + ${h.link_to(_('All Customers'), h.url_for(controller='customer', action='list'))} +| ${h.link_to(_('New Customer'), h.url_for(controller='customer', action='new'))} +| ${h.link_to(_('Edit Customer'), h.url_for(controller='customer', action='edit', id=c.id))} +| ${h.link_to(_('Delete Customer'), h.url_for(controller='customer', action='delete', id=c.id))}

${parent.footer()}