Opened 10 years ago
Last modified 6 years ago
#25113 closed New feature
Field lookup for __not_in — at Version 2
| Reported by: | Evan Tschuy | Owned by: | nobody |
|---|---|---|---|
| Component: | Database layer (models, ORM) | Version: | dev |
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description (last modified by )
Making a query where I can get all of the objects matching a certain list is quite useful. However, Django currently doesn't allow me to get objects that DON'T match a list:
`test = ProductPreparation.objects.filter(
product=product,
preparationidnot_in=preparations)`
I feel like adding a field lookup for __not_in would be helpful. I've created a pull request on Github:
https://github.com/django/django/pull/4984
I've not added any tests to it, as I couldn't find any tests for __in, and don't quite know how to test an entire field lookup. Apologies; would love pointers.
Change History (2)
comment:1 by , 10 years ago
| Description: | modified (diff) |
|---|
comment:2 by , 10 years ago
| Description: | modified (diff) |
|---|