Skip to content

Commit

Permalink
genre-actor_solution
Browse files Browse the repository at this point in the history
  • Loading branch information
Bleit1 committed Jan 7, 2025
1 parent 9c9945e commit eeea3e8
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,17 @@
def main() -> QuerySet:
Genre.objects.create(name="Western")
Genre.objects.create(name="Drama")
Genre.objects.create(name="Comedy")

Genre.objects.create(name="Drama")
Actor.objects.create(first_name="Jaden", last_name="Smith")
Actor.objects.create(first_name="Will", last_name="Smith")
Actor.objects.create(first_name="George", last_name="Clooney")
Actor.objects.create(first_name="Keanu", last_name="Reeves")

Genre.objects.filter(name="Drama").update(name="Drama Updated")

Actor.objects.filter(first_name="Jaden", last_name="Smith").update(
first_name="Jaden Updated", last_name="Smith Updated"
Genre.object.filter(name="Drama").update(name="Drama")
Actor.objects.filter(first_name="Jaden",
last_name="Smith").update(
first_name="Jaden", last_name="Smith"
)

Genre.objects.filter(name="Drama Updated").delete()

Actor.objects.filter(first_name="Jaden Updated").delete()

return Actor.objects.order_by("last_name")
Genre.objects.filter(name="Drama").delete()
Actor.objects.filter(first_name="Jaden").delete()
return Actor.objects.filter(first_name="Jaden").order_by("last_name")

0 comments on commit eeea3e8

Please sign in to comment.