diff options
author | Sergey Fedoseev <fedoseev.sergey@gmail.com> | 2017-07-15 06:56:01 +0500 |
---|---|---|
committer | Tim Graham <timograham@gmail.com> | 2017-07-14 21:56:01 -0400 |
commit | 504ce3914fa86a58f29f5369a806f3fe56a0d59a (patch) | |
tree | 2ea8fe823b87196d6344fb1b3c5b318f71d7ffb8 /django/contrib/postgres | |
parent | 5debbdfcc84266703191e084914998e38f5f52eb (diff) | |
download | django-504ce3914fa86a58f29f5369a806f3fe56a0d59a.tar.gz |
Fixed #28394 -- Allowed setting BaseExpression.output_field (renamed from _output_field).
Diffstat (limited to 'django/contrib/postgres')
-rw-r--r-- | django/contrib/postgres/aggregates/general.py | 2 | ||||
-rw-r--r-- | django/contrib/postgres/fields/jsonb.py | 2 | ||||
-rw-r--r-- | django/contrib/postgres/search.py | 6 |
3 files changed, 5 insertions, 5 deletions
diff --git a/django/contrib/postgres/aggregates/general.py b/django/contrib/postgres/aggregates/general.py index 91835a9ca3..5bbf29e8ab 100644 --- a/django/contrib/postgres/aggregates/general.py +++ b/django/contrib/postgres/aggregates/general.py @@ -37,7 +37,7 @@ class BoolOr(Aggregate): class JSONBAgg(Aggregate): function = 'JSONB_AGG' - _output_field = JSONField() + output_field = JSONField() def convert_value(self, value, expression, connection, context): if not value: diff --git a/django/contrib/postgres/fields/jsonb.py b/django/contrib/postgres/fields/jsonb.py index a3a3381745..a06187c4bc 100644 --- a/django/contrib/postgres/fields/jsonb.py +++ b/django/contrib/postgres/fields/jsonb.py @@ -115,7 +115,7 @@ class KeyTransform(Transform): class KeyTextTransform(KeyTransform): operator = '->>' nested_operator = '#>>' - _output_field = TextField() + output_field = TextField() class KeyTransformTextLookupMixin: diff --git a/django/contrib/postgres/search.py b/django/contrib/postgres/search.py index 9d66976ae0..cc47dbfeb6 100644 --- a/django/contrib/postgres/search.py +++ b/django/contrib/postgres/search.py @@ -47,7 +47,7 @@ class SearchVectorCombinable: class SearchVector(SearchVectorCombinable, Func): function = 'to_tsvector' arg_joiner = " || ' ' || " - _output_field = SearchVectorField() + output_field = SearchVectorField() config = None def __init__(self, *expressions, **extra): @@ -125,7 +125,7 @@ class SearchQueryCombinable: class SearchQuery(SearchQueryCombinable, Value): - _output_field = SearchQueryField() + output_field = SearchQueryField() def __init__(self, value, output_field=None, *, config=None, invert=False): self.config = config @@ -170,7 +170,7 @@ class CombinedSearchQuery(SearchQueryCombinable, CombinedExpression): class SearchRank(Func): function = 'ts_rank' - _output_field = FloatField() + output_field = FloatField() def __init__(self, vector, query, **extra): if not hasattr(vector, 'resolve_expression'): |