From e0837f2cb12de5e95e621d19b186b0da43bcdee2 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Mon, 5 Oct 2015 19:07:34 -0400 Subject: Fixed #25508 -- Modified QuerySet.__repr__() to disambiguate it from a list. --- docs/ref/contrib/postgres/fields.txt | 78 ++++++++++++++++----------------- docs/ref/contrib/postgres/functions.txt | 2 +- 2 files changed, 40 insertions(+), 40 deletions(-) (limited to 'docs/ref/contrib/postgres') diff --git a/docs/ref/contrib/postgres/fields.txt b/docs/ref/contrib/postgres/fields.txt index 587c44a435..defd670e12 100644 --- a/docs/ref/contrib/postgres/fields.txt +++ b/docs/ref/contrib/postgres/fields.txt @@ -120,13 +120,13 @@ data. It uses the SQL operator ``@>``. For example:: >>> Post.objects.create(name='Third post', tags=['tutorial', 'django']) >>> Post.objects.filter(tags__contains=['thoughts']) - [, ] + , ]> >>> Post.objects.filter(tags__contains=['django']) - [, ] + , ]> >>> Post.objects.filter(tags__contains=['django', 'thoughts']) - [] + ]> .. fieldlookup:: arrayfield.contained_by @@ -142,10 +142,10 @@ passed. It uses the SQL operator ``<@``. For example:: >>> Post.objects.create(name='Third post', tags=['tutorial', 'django']) >>> Post.objects.filter(tags__contained_by=['thoughts', 'django']) - [, ] + , ]> >>> Post.objects.filter(tags__contained_by=['thoughts', 'django', 'tutorial']) - [, , ] + , , ]> .. fieldlookup:: arrayfield.overlap @@ -160,10 +160,10 @@ the SQL operator ``&&``. For example:: >>> Post.objects.create(name='Third post', tags=['tutorial', 'django']) >>> Post.objects.filter(tags__overlap=['thoughts']) - [, ] + , ]> >>> Post.objects.filter(tags__overlap=['thoughts', 'tutorial']) - [, , ] + , , ]> .. fieldlookup:: arrayfield.len @@ -177,7 +177,7 @@ available for :class:`~django.db.models.IntegerField`. For example:: >>> Post.objects.create(name='Second post', tags=['thoughts']) >>> Post.objects.filter(tags__len=1) - [] + ]> .. fieldlookup:: arrayfield.index @@ -194,13 +194,13 @@ example:: >>> Post.objects.create(name='Second post', tags=['thoughts']) >>> Post.objects.filter(tags__0='thoughts') - [, ] + , ]> >>> Post.objects.filter(tags__1__iexact='Django') - [] + ]> >>> Post.objects.filter(tags__276='javascript') - [] + .. note:: @@ -222,10 +222,10 @@ lookups available after the transform do not change. For example:: >>> Post.objects.create(name='Third post', tags=['django', 'python', 'thoughts']) >>> Post.objects.filter(tags__0_1=['thoughts']) - [] + ]> >>> Post.objects.filter(tags__0_2__contains='thoughts') - [, ] + , ]> .. note:: @@ -320,12 +320,12 @@ To query based on a given key, you simply use that key as the lookup name:: >>> Dog.objects.create(name='Meg', data={'breed': 'collie'}) >>> Dog.objects.filter(data__breed='collie') - [] + ]> You can chain other lookups after key lookups:: >>> Dog.objects.filter(data__breed__contains='l') - [, ] + , ]> If the key you wish to query by clashes with the name of another lookup, you need to use the :lookup:`hstorefield.contains` lookup instead. @@ -352,10 +352,10 @@ field. It uses the SQL operator ``@>``. For example:: >>> Dog.objects.create(name='Fred', data={}) >>> Dog.objects.filter(data__contains={'owner': 'Bob'}) - [, ] + , ]> >>> Dog.objects.filter(data__contains={'breed': 'collie'}) - [] + ]> .. fieldlookup:: hstorefield.contained_by @@ -372,10 +372,10 @@ example:: >>> Dog.objects.create(name='Fred', data={}) >>> Dog.objects.filter(data__contained_by={'breed': 'collie', 'owner': 'Bob'}) - [, ] + , ]> >>> Dog.objects.filter(data__contained_by={'breed': 'collie'}) - [] + ]> .. fieldlookup:: hstorefield.has_key @@ -389,7 +389,7 @@ Returns objects where the given key is in the data. Uses the SQL operator >>> Dog.objects.create(name='Meg', data={'breed': 'collie', 'owner': 'Bob'}) >>> Dog.objects.filter(data__has_key='owner') - [] + ]> .. fieldlookup:: hstorefield.has_any_keys @@ -406,7 +406,7 @@ operator ``?|``. For example:: >>> Dog.objects.create(name='Fred', data={}) >>> Dog.objects.filter(data__has_any_keys=['owner', 'breed']) - [, ] + , ]> .. fieldlookup:: hstorefield.has_keys @@ -420,7 +420,7 @@ Returns objects where all of the given keys are in the data. Uses the SQL operat >>> Dog.objects.create(name='Meg', data={'breed': 'collie', 'owner': 'Bob'}) >>> Dog.objects.filter(data__has_keys=['breed', 'owner']) - [] + ]> .. fieldlookup:: hstorefield.keys @@ -437,7 +437,7 @@ in conjunction with lookups on >>> Dog.objects.create(name='Meg', data={'breed': 'collie', 'owner': 'Bob'}) >>> Dog.objects.filter(data__keys__overlap=['breed', 'toy']) - [, ] + , ]> .. fieldlookup:: hstorefield.values @@ -454,7 +454,7 @@ using in conjunction with lookups on >>> Dog.objects.create(name='Meg', data={'breed': 'collie', 'owner': 'Bob'}) >>> Dog.objects.filter(data__values__contains=['collie']) - [] + ]> JSONField --------- @@ -521,18 +521,18 @@ name:: >>> Dog.objects.create(name='Meg', data={'breed': 'collie'}) >>> Dog.objects.filter(data__breed='collie') - [] + ]> Multiple keys can be chained together to form a path lookup:: >>> Dog.objects.filter(data__owner__name='Bob') - [] + ]> If the key is an integer, it will be interpreted as an index lookup in an array:: >>> Dog.objects.filter(data__owner__other_pets__0__name='Fishy') - [] + ]> If the key you wish to query by clashes with the name of another lookup, use the :lookup:`jsonfield.contains` lookup instead. @@ -673,7 +673,7 @@ contains '''''''' >>> Event.objects.filter(ages__contains=NumericRange(4, 5)) - [] + ]> .. fieldlookup:: rangefield.contained_by @@ -681,7 +681,7 @@ contained_by '''''''''''' >>> Event.objects.filter(ages__contained_by=NumericRange(0, 15)) - [] + ]> .. versionadded 1.9 @@ -697,7 +697,7 @@ contained_by ... timezone.now() - datetime.timedelta(hours=1), ... timezone.now() + datetime.timedelta(hours=1), ... ) - [] + ]> .. fieldlookup:: rangefield.overlap @@ -705,7 +705,7 @@ overlap ''''''' >>> Event.objects.filter(ages__overlap=NumericRange(8, 12)) - [] + ]> Comparison functions ~~~~~~~~~~~~~~~~~~~~ @@ -726,7 +726,7 @@ all the points in the returned range are less than all those in the passed range. >>> Event.objects.filter(ages__fully_lt=NumericRange(11, 15)) - [] + ]> .. fieldlookup:: rangefield.fully_gt @@ -738,7 +738,7 @@ the all the points in the returned range are greater than all those in the passed range. >>> Event.objects.filter(ages__fully_gt=NumericRange(11, 15)) - [] + ]> .. fieldlookup:: rangefield.not_lt @@ -750,7 +750,7 @@ is the lower bound of the returned range is at least the lower bound of the passed range. >>> Event.objects.filter(ages__not_lt=NumericRange(0, 15)) - [, ] + , ]> .. fieldlookup:: rangefield.not_gt @@ -762,7 +762,7 @@ is the upper bound of the returned range is at most the upper bound of the passed range. >>> Event.objects.filter(ages__not_gt=NumericRange(3, 10)) - [] + ]> .. fieldlookup:: rangefield.adjacent_to @@ -772,7 +772,7 @@ adjacent_to The returned ranges share a bound with the passed range. >>> Event.objects.filter(ages__adjacent_to=NumericRange(10, 21)) - [, ] + , ]> Querying using the bounds ~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -789,7 +789,7 @@ Returned objects have the given lower bound. Can be chained to valid lookups for the base field. >>> Event.objects.filter(ages__startswith=21) - [] + ]> .. fieldlookup:: rangefield.endswith @@ -800,7 +800,7 @@ Returned objects have the given upper bound. Can be chained to valid lookups for the base field. >>> Event.objects.filter(ages__endswith=10) - [] + ]> .. fieldlookup:: rangefield.isempty @@ -811,7 +811,7 @@ Returned objects are empty ranges. Can be chained to valid lookups for a :class:`~django.db.models.BooleanField`. >>> Event.objects.filter(ages__isempty=True) - [] + Defining your own range types ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/docs/ref/contrib/postgres/functions.txt b/docs/ref/contrib/postgres/functions.txt index c97af99bfb..f4abdc2c17 100644 --- a/docs/ref/contrib/postgres/functions.txt +++ b/docs/ref/contrib/postgres/functions.txt @@ -28,4 +28,4 @@ Usage example:: >>> from django.contrib.postgres.functions import TransactionNow >>> Article.objects.filter(published__lte=TransactionNow()) - [] + ]> -- cgit v1.3