Addresses issue #628, using reverse() and the newly created helper function reverse_lazy() (found in ietf/utils/lazy.py) to DRY out the code a bit by decoupling the urls from being hardcoded. With this commit idrfc, and ipr modules have been modified to take advantage of the reverse() and reverse_lazy() functions. - Legacy-Id: 2956 Note: SVN reference [2948] has been migrated to Git commit 9399a2e0e8bbfe5c5a16781fd784776cfa31fbac
24 lines
771 B
Python
24 lines
771 B
Python
# Copyright The IETF Trust 2007, All Rights Reserved
|
|
|
|
from django.conf.urls.defaults import patterns, url
|
|
from ietf.ipr import views, new, search
|
|
from ietf.utils.lazy import reverse_lazy
|
|
from django.views.generic.simple import redirect_to
|
|
|
|
urlpatterns = patterns('',
|
|
url(r'^$', views.showlist, name='ipr_showlist'),
|
|
(r'^about/$', views.default),
|
|
(r'^by-draft/$', views.list_drafts),
|
|
url(r'^(?P<ipr_id>\d+)/$', views.show, name='ipr_show'),
|
|
(r'^update/$', redirect_to, { 'url': reverse_lazy('ipr_showlist') }),
|
|
(r'^update/(?P<ipr_id>\d+)/$', new.update),
|
|
(r'^new-(?P<type>specific)/$', new.new),
|
|
(r'^new-(?P<type>generic)/$', new.new),
|
|
(r'^new-(?P<type>third-party)/$', new.new),
|
|
(r'^search/$', search.search),
|
|
)
|
|
|
|
|
|
|
|
|