#2024년에 만든 Room
>>> Room.objects.filter(created_at__year=2024)
<QuerySet [<Room: Beautiful House in 서울>, <Room: Apt in 서울>]>
#가격이 12 미만인 Room이 존재하는지
>>> Room.objects.filter(price__lt=12).exists()
True
https://docs.djangoproject.com/en/5.0/ref/models/querysets/#id4
QuerySet API reference | Django documentation
The web framework for perfectionists with deadlines.
docs.djangoproject.com
위의 문서에 다양한 QuerySet을 확인할 수 있고 활용하면 됨
filter뿐만아니라
get_or_create(), update_or_create()등 다양한게 있음