summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2014-01-17 17:27:04 -0500
committerTim Graham <timograham@gmail.com>2014-01-17 18:12:45 -0500
commitb87c59b04bc549a5ba42023d04e4be7a4737f7d9 (patch)
tree28882a0befab318da61a839a9ac49ca8e852dc00 /docs
parent298a2b577ffbe7f8ed00588694c792ac9adcefbe (diff)
Removed some unnecessary __exact operators in filters.
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/contrib/sites.txt2
-rw-r--r--docs/topics/auth/default.txt2
-rw-r--r--docs/topics/db/examples/many_to_many.txt6
-rw-r--r--docs/topics/db/examples/many_to_one.txt6
-rw-r--r--docs/topics/db/examples/one_to_one.txt2
-rw-r--r--docs/topics/db/queries.txt4
6 files changed, 11 insertions, 11 deletions
diff --git a/docs/ref/contrib/sites.txt b/docs/ref/contrib/sites.txt
index 24b6294278..80473c59aa 100644
--- a/docs/ref/contrib/sites.txt
+++ b/docs/ref/contrib/sites.txt
@@ -84,7 +84,7 @@ This accomplishes several things quite nicely:
def article_detail(request, article_id):
try:
- a = Article.objects.get(id=article_id, sites__id__exact=get_current_site(request).id)
+ a = Article.objects.get(id=article_id, sites__id=get_current_site(request).id)
except Article.DoesNotExist:
raise Http404
# ...
diff --git a/docs/topics/auth/default.txt b/docs/topics/auth/default.txt
index 2c0ce45482..247f5a38f1 100644
--- a/docs/topics/auth/default.txt
+++ b/docs/topics/auth/default.txt
@@ -101,7 +101,7 @@ You can also change a password programmatically, using
.. code-block:: python
>>> from django.contrib.auth.models import User
- >>> u = User.objects.get(username__exact='john')
+ >>> u = User.objects.get(username='john')
>>> u.set_password('new password')
>>> u.save()
diff --git a/docs/topics/db/examples/many_to_many.txt b/docs/topics/db/examples/many_to_many.txt
index 5b06cde6f6..d127b93b0a 100644
--- a/docs/topics/db/examples/many_to_many.txt
+++ b/docs/topics/db/examples/many_to_many.txt
@@ -111,7 +111,7 @@ Create and add a ``Publication`` to an ``Article`` in one step using
Many-to-many relationships can be queried using :ref:`lookups across
relationships <lookups-that-span-relationships>`::
- >>> Article.objects.filter(publications__id__exact=1)
+ >>> Article.objects.filter(publications__id=1)
[<Article: Django lets you build Web apps easily>, <Article: NASA uses Python>]
>>> Article.objects.filter(publications__pk=1)
[<Article: Django lets you build Web apps easily>, <Article: NASA uses Python>]
@@ -143,7 +143,7 @@ The :meth:`~django.db.models.query.QuerySet.count` function respects
Reverse m2m queries are supported (i.e., starting at the table that doesn't have
a :class:`~django.db.models.ManyToManyField`)::
- >>> Publication.objects.filter(id__exact=1)
+ >>> Publication.objects.filter(id=1)
[<Publication: The Python Journal>]
>>> Publication.objects.filter(pk=1)
[<Publication: The Python Journal>]
@@ -151,7 +151,7 @@ a :class:`~django.db.models.ManyToManyField`)::
>>> Publication.objects.filter(article__headline__startswith="NASA")
[<Publication: Highlights for Children>, <Publication: Science News>, <Publication: Science Weekly>, <Publication: The Python Journal>]
- >>> Publication.objects.filter(article__id__exact=1)
+ >>> Publication.objects.filter(article__id=1)
[<Publication: The Python Journal>]
>>> Publication.objects.filter(article__pk=1)
[<Publication: The Python Journal>]
diff --git a/docs/topics/db/examples/many_to_one.txt b/docs/topics/db/examples/many_to_one.txt
index af112144b3..983bc2eed4 100644
--- a/docs/topics/db/examples/many_to_one.txt
+++ b/docs/topics/db/examples/many_to_one.txt
@@ -123,7 +123,7 @@ This works as many levels deep as you want. There's no limit. For example::
[<Article: This is a test>]
# Find all Articles for any Reporter whose first name is "John".
- >>> Article.objects.filter(reporter__first_name__exact='John')
+ >>> Article.objects.filter(reporter__first_name='John')
[<Article: John's second story>, <Article: This is a test>]
Exact match is implied here::
@@ -134,7 +134,7 @@ Exact match is implied here::
Query twice over the related field. This translates to an AND condition in the
WHERE clause::
- >>> Article.objects.filter(reporter__first_name__exact='John', reporter__last_name__exact='Smith')
+ >>> Article.objects.filter(reporter__first_name='John', reporter__last_name='Smith')
[<Article: John's second story>, <Article: This is a test>]
For the related lookup you can supply a primary key value or pass the related
@@ -184,7 +184,7 @@ Queries can go round in circles::
[<Reporter: John Smith>, <Reporter: John Smith>, <Reporter: John Smith>, <Reporter: John Smith>]
>>> Reporter.objects.filter(article__reporter__first_name__startswith='John').distinct()
[<Reporter: John Smith>]
- >>> Reporter.objects.filter(article__reporter__exact=r).distinct()
+ >>> Reporter.objects.filter(article__reporter=r).distinct()
[<Reporter: John Smith>]
If you delete a reporter, his articles will be deleted (assuming that the
diff --git a/docs/topics/db/examples/one_to_one.txt b/docs/topics/db/examples/one_to_one.txt
index a86e5ed0ac..994794c43b 100644
--- a/docs/topics/db/examples/one_to_one.txt
+++ b/docs/topics/db/examples/one_to_one.txt
@@ -113,7 +113,7 @@ This of course works in reverse::
>>> Place.objects.get(pk=1)
<Place: Demon Dogs the place>
- >>> Place.objects.get(restaurant__place__exact=p1)
+ >>> Place.objects.get(restaurant__place=p1)
<Place: Demon Dogs the place>
>>> Place.objects.get(restaurant=r)
<Place: Demon Dogs the place>
diff --git a/docs/topics/db/queries.txt b/docs/topics/db/queries.txt
index 7b38dbaea3..7f04c66fcb 100644
--- a/docs/topics/db/queries.txt
+++ b/docs/topics/db/queries.txt
@@ -411,7 +411,7 @@ can specify the field name suffixed with ``_id``. In this case, the value
parameter is expected to contain the raw value of the foreign model's primary
key. For example:
- >>> Entry.objects.filter(blog_id__exact=4)
+ >>> Entry.objects.filter(blog_id=4)
If you pass an invalid keyword argument, a lookup function will raise
``TypeError``.
@@ -489,7 +489,7 @@ want.
This example retrieves all ``Entry`` objects with a ``Blog`` whose ``name``
is ``'Beatles Blog'``::
- >>> Entry.objects.filter(blog__name__exact='Beatles Blog')
+ >>> Entry.objects.filter(blog__name='Beatles Blog')
This spanning can be as deep as you'd like.