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
The actual signature of filter method does not permit to resolve automatic filter negations !=.
Automatic filter negation depends on the exclude attribute but this attribute is not accessible with the actual filter method signature.
A possible solution is to change the signature from (qs, name, value) to (qs, name, value, exclude)
class FilterMethod(object):
def __call__(self, qs, value):
if value in EMPTY_VALUES:
return qs
return self.method(qs, self.f.field_name, value, self.f.exclude)
The text was updated successfully, but these errors were encountered:
gustabot42
changed the title
Filter.method do not support negation/exclusion
Filter.method not support negation/exclusion
Oct 31, 2019
As a workaround, you could use partialmethod to bind the filter attribute name to the method, then lookup the filter and its attributes from there. e.g.,
The actual signature of filter method does not permit to resolve automatic filter negations !=.
Automatic filter negation depends on the exclude attribute but this attribute is not accessible with the actual filter method signature.
A possible solution is to change the signature from
(qs, name, value)
to(qs, name, value, exclude)
The text was updated successfully, but these errors were encountered: