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

First commit #947

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

First commit #947

wants to merge 7 commits into from

Conversation

panichqa
Copy link

No description provided.

app/main.py Outdated
# print(Actor.objects.all())
# Actor.objects.delete(1)
# print(Actor.objects.all())
from models import Actor

Choose a reason for hiding this comment

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

no need to push changes to this file

Choose a reason for hiding this comment

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

please revert all changes to this file

Choose a reason for hiding this comment

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

this file should look the same as on master 😿

app/managers.py Outdated
class ActorManager:
def __init__(self) -> None:
self._connection = sqlite3.connect(
"C:\\Users\\vlada\\py-actor-manager\\identifier.sqlite"

Choose a reason for hiding this comment

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

don't hardcode path to db

app/managers.py Outdated

def create(self, first_name: str, last_name: str) -> None:
self._connection.execute(
f"INSERT "

Choose a reason for hiding this comment

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

It is common to use triple quotes for multilne queries
Also check sql format so it follows the standards. This resource will help https://sqlformat.org/

app/managers.py Outdated


if __name__ == "__main__":
manager = ActorManager()

Choose a reason for hiding this comment

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

you don't need this here - code is being executed in main

table.png Outdated

Choose a reason for hiding this comment

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

there is no requirement to upload screenshot in this task

app/managers.py Outdated
Comment on lines 38 to 40
f"""UPDATE {self.table_name} """
f"""SET first_name = ?, last_name = ? """
f"""WHERE id = ?""",

Choose a reason for hiding this comment

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

No need to put triple quotes in each line, the main idea put it in the beginning and in the end, chek everywhere

app/main.py Outdated
# print(Actor.objects.all())
# Actor.objects.delete(1)
# print(Actor.objects.all())
from models import Actor

Choose a reason for hiding this comment

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

please revert all changes to this file

@@ -0,0 +1,57 @@
import sqlite3
import os
from models import Actor

Choose a reason for hiding this comment

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

should be blank line between imports

app/managers.py Outdated
class ActorManager:
def __init__(self) -> None:
self._connection = sqlite3.connect(
os.path.join(os.path.dirname(__file__), "identifier.sqlite")

Choose a reason for hiding this comment

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

database name should be cinema as per task requirements

app/managers.py Outdated
def all(self) -> None:
actor_manager_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.

should be
SELECT *
FROM {self.table_name}
SQL keywords must start from new lines

app/main.py Outdated
# print(Actor.objects.all())
# Actor.objects.delete(1)
# print(Actor.objects.all())
from models import Actor

Choose a reason for hiding this comment

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

this file should look the same as on master 😿

app/managers.py Outdated
@@ -0,0 +1,60 @@
import sqlite3

Choose a reason for hiding this comment

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

should be blank line between different types of imports - os and sqlite3 are build-in so they are the same type. only from app.models import Actor should be separated

Copy link

@Oleksl888 Oleksl888 left a comment

Choose a reason for hiding this comment

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

Approved..

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