summaryrefslogtreecommitdiff
path: root/docs/db-api.txt
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2007-09-13 02:48:06 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2007-09-13 02:48:06 +0000
commit4751fd9ba7dd761430be4b00b88221c6d2240f90 (patch)
tree3748fee4ede89edf4b03b8144cc214cb6b2ec34a /docs/db-api.txt
parent2d07a19c19625685e54ebc9ae94003dbe1584a8b (diff)
Added a note about not using 'pk' as a field name for a non-primary-key field.
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6114 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/db-api.txt')
-rw-r--r--docs/db-api.txt5
1 files changed, 5 insertions, 0 deletions
diff --git a/docs/db-api.txt b/docs/db-api.txt
index 2a90b2d171..d1646ba6ea 100644
--- a/docs/db-api.txt
+++ b/docs/db-api.txt
@@ -1348,6 +1348,11 @@ equivalent::
Entry.objects.filter(blog__id=3) # __exact is implied
Entry.objects.filter(blog__pk=3) # __pk implies __id__exact
+.. note::
+ Because of this shortcut, you cannot have a field in your model called
+ ``pk`` that is not the primary key of the model. It will always be
+ replaced by the name of the model's primary key in queries.
+
Lookups that span relationships
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~