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 #462

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

Solution #462

wants to merge 6 commits into from

Conversation

nyanplague
Copy link

No description provided.

Copy link

@9rosLove 9rosLove left a comment

Choose a reason for hiding this comment

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

👍

Choose a reason for hiding this comment

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

read the checklist

app/managers.py Outdated

def all(self) -> List[Actor]:
actors_cursor = self._connection.execute(
f"SELECT * FROM {self.table_name}"

Choose a reason for hiding this comment

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

it's better to move FROM to the new line, increase readability

app/managers.py Outdated

def delete(self, id_to_delete: int) -> None:
self._connection.execute(
f"DELETE FROM {self.table_name} " f"WHERE id = ?", (id_to_delete,)

Choose a reason for hiding this comment

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

The same about WHERE

app/managers.py Outdated
Comment on lines 55 to 57
if __name__ == "__main__":
manager = ActorManager()
print(manager.all())

Choose a reason for hiding this comment

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

redundant

app/managers.py Outdated
Comment on lines 40 to 44
self._connection.execute(
f"UPDATE {self.table_name} "
f"SET first_name = ?, last_name = ?"
f"WHERE id = ?",
(new_first_name, new_last_name, id_to_update),

Choose a reason for hiding this comment

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

I think you have syntax error here in SQL query

Copy link
Author

Choose a reason for hiding this comment

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

@Serhii-Leonenko I don't see what's wrong here, can you explain ? :(

Copy link
Author

Choose a reason for hiding this comment

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

Ok, maybe whitespace after last_name? :)

Copy link

@Serhii-Leonenko Serhii-Leonenko left a comment

Choose a reason for hiding this comment

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

Did you run your code?)

image

@@ -40,7 +40,7 @@ def update(
) -> None:
self._connection.execute(
f"UPDATE {self.table_name} "
f"SET first_name = ?, last_name = ?"
f"SET first_name = ?, last_name = ? "

Choose a reason for hiding this comment

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

Yes, i told about this space

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