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 2888423 commit 866ad68
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion db/models.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from django.db import models



class Genre(models.Model):
name = models.CharField(max_length=100)


class Actor(models.Model):
first_name = models.CharField(max_length=255)
last_name = models.CharField(max_length=255)
9 changes: 3 additions & 6 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,10 @@ def main() -> QuerySet:
Actor.objects.create(first_name="George", last_name="Clooney")
Actor.objects.create(first_name="Keanu", last_name="Reeves")

Genre.object.filter(name="Drama").update(name = "Drama")
Genre.object.filter(name="Drama").update(name="Drama")
Actor.objects.filter(first_name="Jaden",
last_name = "Smith").update(first_name = "Jaden",
last_name = "Smith")
last_name="Smith").update(first_name="Jaden",
last_name="Smith")
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 866ad68

Please sign in to comment.