Challenge: AuthMixin
Compito
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.
Soluzione
Tutto è chiaro?
Grazie per i tuoi commenti!
Sezione 4. Capitolo 3
single
Chieda ad AI
Chieda ad AI
Chieda pure quello che desidera o provi una delle domande suggerite per iniziare la nostra conversazione
Suggested prompts:
Riassuma questo capitolo
Explain code
Explain why doesn't solve task
Awesome!
Completion rate improved to 2.78
Challenge: AuthMixin
Scorri per mostrare il menu
Compito
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.
Soluzione
Tutto è chiaro?
Grazie per i tuoi commenti!
Sezione 4. Capitolo 3
single