Read the guideline before starting.
In this task, you should create a manager for the dataclass Actor
.
Actor
should have the following attributes:
id
- unique identifier for each actorfirst_name
- actor's first namelast_name
- actor's last name
Create a database cinema
where will be stored entries with data about different actors and actresses.
Create a table actors
with corresponding columns.
Now, you are ready to create a manager.
Create ActorManager
class that should provide CRUD operations.
It should create a connection to the database inside the constructor.
The manager should have the following methods:
create
- a method that creates a new entry in theactors
table with given properties.all
- a method that returns a list ofActor
instances from DBupdate
- a method that updates properties for entry with givenid
delete
- a method that deletes entry with givenid
from DB
Test different methods in the main.py
module.