diff options
| author | Adrian Holovaty <adrian@holovaty.com> | 2005-07-26 16:11:43 +0000 |
|---|---|---|
| committer | Adrian Holovaty <adrian@holovaty.com> | 2005-07-26 16:11:43 +0000 |
| commit | 786c750c40417a59449f1c5595fcc6b370ca7d4f (patch) | |
| tree | c642a693e5179e42feb793b0cb4d23451f81eeb0 /docs/db-api.txt | |
| parent | f14c98e44c388e7171977b9be8d70dd3176d7919 (diff) | |
Fixed #163 -- Added 'pk' database API option, which is a shorthand for (primary_key)__exact
git-svn-id: http://code.djangoproject.com/svn/django/trunk@316 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/db-api.txt')
| -rw-r--r-- | docs/db-api.txt | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/docs/db-api.txt b/docs/db-api.txt index 401d9d3260..cb5ec4783f 100644 --- a/docs/db-api.txt +++ b/docs/db-api.txt @@ -97,6 +97,19 @@ Multiple lookups are allowed, of course, and are translated as "AND"s:: ...retrieves all polls published in January 2005 that have a question starting with "Would." +For convenience, there's a ``pk`` lookup type, which translates into +``(primary_key)__exact``. In the polls example, these two statements are +equivalent:: + + polls.get_object(id__exact=3) + polls.get_object(pk=3) + +``pk`` lookups also work across joins. In the polls example, these two +statements are equivalent:: + + choices.get_list(poll__id__exact=3) + choices.get_list(poll__pk=3) + Ordering ======== |
