Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Challenge: AuthMixin | Polymorphism and Abstraction
In-Depth Python OOP
course content

Зміст курсу

In-Depth Python OOP

Challenge: AuthMixin

Завдання

Let's make your code more flexible.

  1. Define the AuthMixin class.
  2. Cut the login and logout methods from the User class and insert them into the AuthMixin body.
  3. Move the is_authenticated class attribute to the AuthMixin.
  4. Inherit the User class from the AuthMixin.

Note

After performing all the actions, you will have an authorization mixin (AuthMixin) that can be used for different user classes.

Завдання

Let's make your code more flexible.

  1. Define the AuthMixin class.
  2. Cut the login and logout methods from the User class and insert them into the AuthMixin body.
  3. Move the is_authenticated class attribute to the AuthMixin.
  4. Inherit the User class from the AuthMixin.

Note

After performing all the actions, you will have an authorization mixin (AuthMixin) that can be used for different user classes.

Все було зрозуміло?

Секція 4. Розділ 3
toggle bottom row

Challenge: AuthMixin

Завдання

Let's make your code more flexible.

  1. Define the AuthMixin class.
  2. Cut the login and logout methods from the User class and insert them into the AuthMixin body.
  3. Move the is_authenticated class attribute to the AuthMixin.
  4. Inherit the User class from the AuthMixin.

Note

After performing all the actions, you will have an authorization mixin (AuthMixin) that can be used for different user classes.

Завдання

Let's make your code more flexible.

  1. Define the AuthMixin class.
  2. Cut the login and logout methods from the User class and insert them into the AuthMixin body.
  3. Move the is_authenticated class attribute to the AuthMixin.
  4. Inherit the User class from the AuthMixin.

Note

After performing all the actions, you will have an authorization mixin (AuthMixin) that can be used for different user classes.

Все було зрозуміло?

Секція 4. Розділ 3
toggle bottom row

Challenge: AuthMixin

Завдання

Let's make your code more flexible.

  1. Define the AuthMixin class.
  2. Cut the login and logout methods from the User class and insert them into the AuthMixin body.
  3. Move the is_authenticated class attribute to the AuthMixin.
  4. Inherit the User class from the AuthMixin.

Note

After performing all the actions, you will have an authorization mixin (AuthMixin) that can be used for different user classes.

Завдання

Let's make your code more flexible.

  1. Define the AuthMixin class.
  2. Cut the login and logout methods from the User class and insert them into the AuthMixin body.
  3. Move the is_authenticated class attribute to the AuthMixin.
  4. Inherit the User class from the AuthMixin.

Note

After performing all the actions, you will have an authorization mixin (AuthMixin) that can be used for different user classes.

Все було зрозуміло?

Завдання

Let's make your code more flexible.

  1. Define the AuthMixin class.
  2. Cut the login and logout methods from the User class and insert them into the AuthMixin body.
  3. Move the is_authenticated class attribute to the AuthMixin.
  4. Inherit the User class from the AuthMixin.

Note

After performing all the actions, you will have an authorization mixin (AuthMixin) that can be used for different user classes.

Секція 4. Розділ 3
Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
We're sorry to hear that something went wrong. What happened?
some-alt