Error in Models Documentation

33 views
Skip to first unread message

Pranav Mittal

unread,
Oct 10, 2021, 8:31:36 AM10/10/21
to Django developers (Contributions to Django itself)
Hello everyone.

https://docs.djangoproject.com/en/3.2/ref/models/querysets/#django.db.models.query.QuerySet.exclude

The second example mentions that the query will return entries whose pub_date is later than 2005-1-3 OR whose headline is “Hello”.

But the equivalent SQL statement mentions AND.


Untitled.png

Ken Whitesell

unread,
Oct 10, 2021, 8:40:16 AM10/10/21
to django-d...@googlegroups.com
This is not an error.

The identified example does _not_ say that it will "return" those entries. It states it will _exclude_ entries matching either of those two conditions.

Likewise, the SQL statement referenced is a negation ("and not") of the condition.

This portion of the documentation is accurate and correct with what it's saying.

Ken
--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-develop...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/9028b784-9bd8-4207-91e0-d46e9907fb44n%40googlegroups.com.


Reply all
Reply to author
Forward
0 new messages