Hi Emil,

that's not only a teaching issue. Also experienced devs struggle with this 
way to declaring URLs.


Internally, we developed a UrlMixin for our view classes such as:


class MyView(UrlMixin, View):
    url_pattern = r'^bar/foo/$'
    view_name = 'my-index'
    # rest of view code


That's all we need to do in order to define a *view with a working url 
pattern*.


Reverse works with the optional view_name or by reversing the class itself.

Maybe, the simplification of your proposal could be explored by providing 
such a UrlMixin first.


Best,
Sven

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/20a1c1c5-8d5c-49f7-b770-880b7f231798%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to