Skip to content

Commit

Permalink
fixed sorting by last_name
Browse files Browse the repository at this point in the history
  • Loading branch information
Yurii-Durden committed Nov 18, 2024
1 parent 7ab807d commit 04996ac
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ def main() -> QuerySet:
("Scarlett", "Johansson")
]


for genre in genres:
Genre.objects.create(name=genre)

Expand All @@ -31,7 +32,7 @@ def main() -> QuerySet:
Genre.objects.filter(name="Action").delete()
Actor.objects.filter(first_name="Scarlett").delete()

return Actor.objects.all().order_by("first_name")
return Actor.objects.all().order_by("last_name")


if __name__ == "__main__":
Expand Down
4 changes: 4 additions & 0 deletions settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.abspath(__file__))

INSTALLED_APPS = [
"db"
]

# SECURITY WARNING: Modify this secret key if using in production!
SECRET_KEY = "6few3nci_q_o@l1dlbk81%wcxe!*6r29yu629&d97!hiqat9fa"

Expand Down

0 comments on commit 04996ac

Please sign in to comment.