classy-python/ccbv

New Authentication Mixins

polarise opened this issue · 5 comments

Greetings!

Great job with this site. If it were up to me this resource would be on the official Django website.

I've noticed that there are several new mixins for authentication (LoginRequiredMixin, AccessMixin, UserPassesTestMixin, ...). Any plans to incorporate these?

Thanks.

polarise

Hi

Thanks for the suggestion, and it's definitely something that should be addressed. It came up recently in #103 but the underlying change it would need to make it work (because these mixins live in contrib.auth.mixins and not with the generic CBVs) was first discussed a couple of years ago in the context of the WizardView(#89).

I don't think it would be too big a bit of work (import script, tests, making sure that they fit into the menu system sensibly) it just needs a bit of impetus to get it done so it's hard to tell when someone will get around to it. As I said last time, I might look at this soon, but life may get in the way.

If you fancied taking a look at it and submitting a PR in any state of completion, even if it's just a starting point for someone else to finish off, then I think that's always going to be welcome too.

Michael

I decided to have a pop at this and am making fairly tidy progress with it, so should hopefully have a PR to submit tomorrow.

You're my hero!

Ha, we'll see!
As it happens, I've just this week upgraded to 1.9 at work so pretty soon I'm going to want this quite badly myself too.

Think I might have the code ready now, just need to regenerate fixtures and commit those.

… are now live! Big thanks to @exonian for putting in the work to add them.