[patch] add 'not'-variants to some lookup kwargs
|Reported by:||hugo||Owned by:||Adrian Holovaty|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Currently there are no 'inotcontains', 'notcontains', 'notstartswith', 'notendswith' queries which makes it awkward if you want to build a query that searches for all stuff that includes 'foo' but doesn't include 'bar' - you need to fetch IDs and filter IDs based on those results yourself.
This could be done in two ways: either just add those query lookup kwargs to the backends (mapping them to the matching NOT LIKE clauses) or enhance the AND/OR combinator syntax by introducing not handling (creating a Qnot object that will render as NOT(condition) in the SQL). The first version is much easier to do and fit's nicely into the current kwarg-based query syntax, so I would opt for that version.
Change History (5)
comment:1 Changed 11 years ago by
|Summary:||add 'not'-variants to some lookup kwargs → [patch] add 'not'-variants to some lookup kwargs|