Complete the code to import F expressions from Django.
from django.db.models import [1]
The F class is imported from django.db.models to allow field comparisons in queries.
Complete the code to filter objects where 'price' is greater than 'cost' using F expressions.
Product.objects.filter(price__[1]=F('cost'))
The lookup gt means 'greater than'. This filters products where price is greater than cost.
Fix the error in the code to compare 'quantity' with 'minimum_quantity' using F expressions.
Inventory.objects.filter(quantity__[1]=F('minimum_quantity'))
The correct lookup for equality in Django queries is exact. 'eq', 'equals', and 'is' are invalid lookups.
Fill both blanks to update 'stock' by subtracting 'sold' using F expressions.
Product.objects.update(stock=F('stock') [1] F('[2]'))
To reduce stock by the sold amount, subtract 'sold' from 'stock' using the '-' operator and the field name 'sold'.
Fill all three blanks to filter orders where 'total' is at least twice the 'cost'.
Order.objects.filter(total__[1]=F('cost') [2] [3])
Use 'gte' for 'greater than or equal', multiply 'cost' by 2 using '* 2' to compare with 'total'.