You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@simkimsia
The where method accepts a Q object, which can be negated with a ~ as @firemark suggested. It would be nice to have a "not equals" operator to do things like .where(field__not='value') so I'll leave this ticket open as a reminder and update the docs with examples.
In [19]: from django.db.models import Q
In [20]: q = Query().from_table(Account).where(~Q(first_name='Test'))
In [21]: q.get_sql()
Out[21]: 'SELECT account_account.* FROM account_account WHERE ((NOT(first_name = %(A0)s)))'
Hi there,
I know that Django QuerySet typically favors
exclude
to cater for not equal queriesI wonder how django query builder handles not equal operator?
The text was updated successfully, but these errors were encountered: