Complete the code to filter users with the exact username 'alice'.
users = User.objects.filter(username__[1]='alice')
The exact lookup matches the field value exactly. Here, it filters users whose username is exactly 'alice'.
Complete the code to find products whose name contains the word 'book'.
products = Product.objects.filter(name__[1]='book')
The contains lookup finds records where the field includes the given substring anywhere inside it.
Fix the error in filtering orders with amount greater than 100.
orders = Order.objects.filter(amount__[1]=100)
The gt lookup means 'greater than'. It filters orders with amount more than 100.
Fill both blanks to filter events with date less than '2024-01-01' and name containing 'conference'.
events = Event.objects.filter(date__[1]='2024-01-01', name__[2]='conference')
Use lt for dates less than the given date, and contains to find names including 'conference'.
Fill all three blanks to create a dictionary with keys as lowercase usernames and values as emails for users with id greater than 10.
user_dict = {user.username.[1](): user.[2] for user in User.objects.filter(id__[3]=10)}Use lower() to convert usernames to lowercase (common for keys), email to get user emails, and gt to filter users with id greater than 10.