Comparison Field Lookup

Report a typo

You have two models. One is Engine, with the following fields: type and volume. The other one is Car, with color, engine, and speed set as fields:

class Engine(models.Model):
    type = models.CharField(max_length=32)
    volume = models.IntegerField()


class Car(models.Model):
    color = models.CharField(max_length=32)
    engine = models.ForeignKey(Engine, on_delete=models.CASCADE)
    speed = models.FloatField()

Filter cars with a speed greater than or equal to 200. The result must be a QuerySet object.

Sample Input 1:

Sample Output 1:

True
Write a program in Python 3
fast_cars = ...
___

Create a free account to access the full topic