Would it be possible to introduce such thing for Django?
Internally, we are working on something like this in order to accelerate
development and maintenance for our production system.
Manually looking up URLs in the url.py and then jump to the actual view
class is quite error-prone and tedious.
Internally, we evaluate two alternatives:
1) via class attribute: url
2) via decorator on class
{{{
# alternative 1
class ThingView(DetailView):
url = '/thing(?P<pk>\d+)'
template_name = 'thing.html'
# alternative 2
@url('/thing/(?P<pk>\d+)'):
class ThingView(DetailView):
template_name = 'thing.html'
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/25907>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* needs_better_patch: => 0
* resolution: => wontfix
* needs_tests: => 0
* needs_docs: => 0
Comment:
You could propose it on the DevelopersMailingList (I couldn't find a past
discussion from a quick seach), but I doubt we'd want to add another way
of defining URLs. If you really want this in your own projects, you could
possibly write an implantation that lives in each app's `urls.py` file and
"autodiscovers" the URLs defined by your views according to whatever
convention you want to use.
--
Ticket URL: <https://code.djangoproject.com/ticket/25907#comment:1>
* cc: tzanke@… (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/25907#comment:2>