- exclude(): The .exclude() method allows you to exclude records that match certain conditions.
from myapp.models import BlogPost nontech_post= BlogPost.objects.exclude(category='Tech')
Last updated 1 year ago