summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorJannis Leidel <jannis@leidel.info>2011-06-28 10:16:18 +0000
committerJannis Leidel <jannis@leidel.info>2011-06-28 10:16:18 +0000
commitdbffffa7dc95fc62cbecfd00284bde62ee796f48 (patch)
treed481cff58c0a77044407d99d0ccbe5a50004d842 /docs
parentf54135fa4dc9fd45d86ea2944191d58e00725779 (diff)
Fixed #5535 -- Allow using an explicit foreign key in get() calls. Thanks, Michal Petrucha.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16473 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs')
-rw-r--r--docs/topics/db/queries.txt10
1 files changed, 10 insertions, 0 deletions
diff --git a/docs/topics/db/queries.txt b/docs/topics/db/queries.txt
index 3457913011..a4267489b9 100644
--- a/docs/topics/db/queries.txt
+++ b/docs/topics/db/queries.txt
@@ -365,6 +365,16 @@ translates (roughly) into the following SQL::
.. _`Keyword Arguments`: http://docs.python.org/tutorial/controlflow.html#keyword-arguments
+.. versionchanged:: 1.4
+
+ The field specified in a lookup has to be the name of a model field.
+ There's one exception though, in case of a
+ :class:`~django.db.models.fields.ForeignKey` you 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)
+
If you pass an invalid keyword argument, a lookup function will raise
``TypeError``.