Re: adding permission_required decorator for class based view

2022-02-10 Thread Martin Milon
The introduction doc to class based view https://docs.djangoproject.com/en/4.0/topics/class-based-views/intro/ seems to prefer decorators, as it only illustrates the decorator side of things with code blocks, and doesn't illustrate mixins at all. If the mixins are the way to go, it should be ref

adding permission_required decorator for class based view

2022-02-09 Thread Martin Milon
Hi, as of today, adding a permission_required and / or a login_required decorator on a class based view is a bit ugly, as you have to decorate the dispatch method, which you then have to write down in your class. On top of that, you can't directly use the decorator itself, as you have to wrap i