Hello, currently url patterns are hard coded into urls.py, in the
templates, and in some cases the views which return redirects. This is
becoming a dangerous practice in our application development. If one
url needs to be changed due to an update in the application design, it
would break many pages/views.
Is there a contrib module or do I need to roll my own URL helper class
that allows my developers to do something like the following in
urls.py:
URL_VIEW_RESPONSE = 1
urlpatterns += urlhelper.create(URL_VIEW_RESPONSE,
'^view/(?P<x_id>\d+)/current/(?P<y_id>\d+)/$', 'x_y_view')
Then in a template, refer to url as (using some fictional 'url'
templatetag):
<a href="{% url URL_VIEW_RESPONSE x.id y.id %}">link</a>
Or in a view as:
return HttpRedirectResponse(urlhelper.get(URL_VIEW_RESPONSE, x.id,
y.id))
Please advise, thanks. Ed.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---