Challenge: AuthMixin
Opgave
Swipe to start coding
Let's make your code more flexible.
- Define the
AuthMixinclass. - Cut the
loginandlogoutmethods from theUserclass and insert them into theAuthMixinbody. - Move the
is_authenticatedclass attribute to theAuthMixin. - Inherit the
Userclass from theAuthMixin.
Note
After performing all the actions, you will have an authorization mixin (
AuthMixin) that can be used for different user classes.
Løsning
Var alt klart?
Tak for dine kommentarer!
Sektion 4. Kapitel 3
single
Spørg AI
Spørg AI
Spørg om hvad som helst eller prøv et af de foreslåede spørgsmål for at starte vores chat
Suggested prompts:
Opsummér dette kapitel
Explain code
Explain why doesn't solve task
Awesome!
Completion rate improved to 2.78
Challenge: AuthMixin
Stryg for at vise menuen
Opgave
Swipe to start coding
Let's make your code more flexible.
- Define the
AuthMixinclass. - Cut the
loginandlogoutmethods from theUserclass and insert them into theAuthMixinbody. - Move the
is_authenticatedclass attribute to theAuthMixin. - Inherit the
Userclass from theAuthMixin.
Note
After performing all the actions, you will have an authorization mixin (
AuthMixin) that can be used for different user classes.
Løsning
Var alt klart?
Tak for dine kommentarer!
Sektion 4. Kapitel 3
single