In the chapter:
4. How to do a NOT query in Django queryset?
4.1. The query in detail
There are 2 example one is using exclude(<condition>) and another using filter(~Q(<condition>)) but the first example under Method 1 using exclude is missing.
The example should be like this
queryset = User.objects.exclude(id__lt=5)
queryset
<QuerySet [<User: Ritesh>, <User: Billy>, <User: Radha>, <User: Sohan>, <User: Raghu>, <User: Rishab>]>