@@ -310,6 +310,7 @@ class QueryList(list[T]):
310310 ... },
311311 ... ]
312312 ... )
313+
313314 >>> query.filter(place="Chicago suburbs")[0]['city']
314315 'Elmhurst'
315316 >>> query.filter(place__icontains="chicago")[0]['city']
@@ -321,6 +322,16 @@ class QueryList(list[T]):
321322 >>> query.filter(foods__fruit__in="orange")[0]['city']
322323 'Tampa'
323324
325+ >>> query.filter(foods__fruit__in="apple")
326+ [{'place': 'Chicago suburbs',
327+ 'city': 'Elmhurst',
328+ 'state': 'Illinois',
329+ 'foods':
330+ {'fruit': ['apple', 'cantelope'], 'breakfast': 'waffles'}}]
331+
332+ >>> query.filter(foods__fruit__in="non_existent")
333+ []
334+
324335 **With objects**:
325336
326337 >>> from typing import Any
@@ -389,7 +400,7 @@ class QueryList(list[T]):
389400 ... ),
390401 ... Restaurant(
391402 ... place="Chicago suburbs",
392- ... city="Elmhurt ",
403+ ... city="Elmhurst ",
393404 ... state="Illinois",
394405 ... food=Food(
395406 ... fruit=["apple", "cantelope"], breakfast="waffles"
@@ -405,6 +416,18 @@ class QueryList(list[T]):
405416
406417 >>> query.filter(food__fruit__in="banana")[0].city
407418 'Tampa'
419+
420+ >>> query.filter(food__breakfast="waffles")
421+ [Restaurant(place='Chicago suburbs',
422+ city='Elmhurst',
423+ state='Illinois',
424+ food=Food(fruit=['apple', 'cantelope'], breakfast='waffles'))]
425+
426+ >>> query.filter(food__breakfast="waffles")[0].city
427+ 'Elmhurst'
428+
429+ >>> query.filter(food__breakfast="non_existent")
430+ []
408431 """
409432
410433 data : Sequence [T ]
0 commit comments