diff options
| author | Georg Bauer <gb@hugo.westfalen.de> | 2005-11-03 21:29:48 +0000 |
|---|---|---|
| committer | Georg Bauer <gb@hugo.westfalen.de> | 2005-11-03 21:29:48 +0000 |
| commit | e27211a0deae2f1d402537f0ebb64ad4ccf6a4da (patch) | |
| tree | 73ba55f337e0d5c6e4ed39474ab6132879cc3947 /tests/testapp/models/basic.py | |
| parent | 9e724c25236b1e00a36a146e66b5deaa43d2af96 (diff) | |
| parent | cb45fd0ae20597306cd1f877efc99d9bd7cbee98 (diff) | |
i18n: merged to [1054] of trunkarchive/attic/i18n
git-svn-id: http://code.djangoproject.com/svn/django/branches/i18n@1067 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/testapp/models/basic.py')
| -rw-r--r-- | tests/testapp/models/basic.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/testapp/models/basic.py b/tests/testapp/models/basic.py index ebd784137a..ad2a8cb862 100644 --- a/tests/testapp/models/basic.py +++ b/tests/testapp/models/basic.py @@ -51,6 +51,17 @@ datetime.datetime(2005, 7, 28, 0, 0) <Article object> >>> articles.get_object(pub_date__year=2005) <Article object> +>>> articles.get_object(pub_date__year=2005, pub_date__month=7) +<Article object> +>>> articles.get_object(pub_date__year=2005, pub_date__month=7, pub_date__day=28) +<Article object> + +>>> articles.get_list(pub_date__year=2005) +[<Article object>] +>>> articles.get_list(pub_date__year=2004) +[] +>>> articles.get_list(pub_date__year=2005, pub_date__month=7) +[<Article object>] # Django raises an ArticleDoesNotExist exception for get_object() >>> articles.get_object(id__exact=2) @@ -58,6 +69,11 @@ Traceback (most recent call last): ... ArticleDoesNotExist: Article does not exist for {'id__exact': 2} +>>> articles.get_object(pub_date__year=2005, pub_date__month=8) +Traceback (most recent call last): + ... +ArticleDoesNotExist: Article does not exist for ... + # Lookup by a primary key is the most common case, so Django provides a # shortcut for primary-key exact lookups. # The following is identical to articles.get_object(id__exact=1). |
