diff options
author | Vytis Banaitis <vytis.banaitis@gmail.com> | 2017-02-01 18:41:56 +0200 |
---|---|---|
committer | Tim Graham <timograham@gmail.com> | 2017-02-01 11:41:56 -0500 |
commit | 8838d4dd498c8f66ea4237fe8a79a5f77d6f95c9 (patch) | |
tree | b75fa27930b8758ad36669b523b084ac09ce290b /django/contrib/postgres/search.py | |
parent | 0ec4dc91e0e7befdd06aa0613b5d0fbe3c785ee7 (diff) | |
download | django-8838d4dd498c8f66ea4237fe8a79a5f77d6f95c9.tar.gz |
Refs #23919 -- Replaced kwargs.pop() with keyword-only arguments.
Diffstat (limited to 'django/contrib/postgres/search.py')
-rw-r--r-- | django/contrib/postgres/search.py | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/django/contrib/postgres/search.py b/django/contrib/postgres/search.py index 9a773db1d5..9d66976ae0 100644 --- a/django/contrib/postgres/search.py +++ b/django/contrib/postgres/search.py @@ -125,13 +125,11 @@ class SearchQueryCombinable: class SearchQuery(SearchQueryCombinable, Value): - invert = False _output_field = SearchQueryField() - config = None - def __init__(self, value, output_field=None, **extra): - self.config = extra.pop('config', self.config) - self.invert = extra.pop('invert', self.invert) + def __init__(self, value, output_field=None, *, config=None, invert=False): + self.config = config + self.invert = invert super().__init__(value, output_field=output_field) def resolve_expression(self, query=None, allow_joins=True, reuse=None, summarize=False, for_save=False): @@ -161,11 +159,7 @@ class SearchQuery(SearchQueryCombinable, Value): return combined def __invert__(self): - extra = { - 'invert': not self.invert, - 'config': self.config, - } - return type(self)(self.value, **extra) + return type(self)(self.value, config=self.config, invert=not self.invert) class CombinedSearchQuery(SearchQueryCombinable, CombinedExpression): |