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 ActorManager class that should provide CRUD operations.
It must take 2 parameters db_name and table_name in the __init__ method.
It should create a connection to the database inside the __init__ method.
The manager should have the following methods:
-
create- a method that creates a new entry in the table. It must take 2 parametersfirst_nameandlast_nameand create a new entry in the table with given properties. -
all- a method that returns a list ofActorinstances from DB. It must return an empty list if there are no entries in the table. -
update- a method that updates properties for entry with givenpk. It must take 3 parameterspk,new_first_nameandnew_last_name -
delete- a method that deletes entry with givenpkfrom DB. It must take 1 parameterpk