Queryset doesn't have a "not equal" filter operator
|Reported by:||jdetaeye||Owned by:||nobody|
|Component:||Database layer (models, ORM)||Version:||master|
|Cc:||German M. Bravo, carsten.fuchs@…, unai@…||Triage Stage:||Design decision needed|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Querysets can be filter for 'gt', 'gte', 'lt', 'lte', 'exact'.
The ability to filter for inequality / 'ne' is not in the list.
Using 'exclude' it is possible to negate a filter, but it's not as clear and clean as a direct filter. Including an inequality operator isn't hard and difficult, I believe.
In case this feature is accepted to be included in Django, feel free to assign it to me: I'm willing to take on creating the patch, its documentation and testing.
Change History (27)
comment:13 Changed 5 years ago by
|Status:||reopened → closed|