Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solution actor manager #443

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

MarkShapka
Copy link

No description provided.

app/managers.py Outdated

def all(self) -> None:
actors_cursor = self._connection.execute(
"SELECT id, first_name, last_name FROM actors"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use * to select all the columns from the table.

It is better to create an attribute to store the table name. By defining the table name as an attribute, you make the code more flexible and easier to update if the table name ever needs to be changed.

class ActorManager:
def __init__(self) -> None:
self._connection = sqlite3.connect("cinema.db3")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You haven't fixed the previous comment regarding the table name.

Create an attribute to store the table name and use it throughout your code.

Suggested change
self.table_name = "actors"

Copy link

@Polyakiv-Andrey Polyakiv-Andrey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants