diff --git a/db/models.py b/db/models.py index d8e39d37..2de1bbfe 100644 --- a/db/models.py +++ b/db/models.py @@ -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) diff --git a/main.py b/main.py index d4201187..b9319615 100644 --- a/main.py +++ b/main.py @@ -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") - - -