diff options
| author | Jacob Kaplan-Moss <jacob@jacobian.org> | 2006-06-27 20:36:25 +0000 |
|---|---|---|
| committer | Jacob Kaplan-Moss <jacob@jacobian.org> | 2006-06-27 20:36:25 +0000 |
| commit | 48562965b900bd8d4ba5f6fef4b635af844b5cee (patch) | |
| tree | 01f9d4bdf1790bb6882ff25b695cf907233726c6 /tests | |
| parent | 2adbe11678030a019c1e279501e688acae3f85ce (diff) | |
Added {{{Manager.create()}}} method to create and save an object in a single step.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3217 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/modeltests/basic/models.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/modeltests/basic/models.py b/tests/modeltests/basic/models.py index a4de0f9a81..78d943eb97 100644 --- a/tests/modeltests/basic/models.py +++ b/tests/modeltests/basic/models.py @@ -347,4 +347,9 @@ API_TESTS += """ >>> a101 = Article.objects.get(pk=101) >>> a101.headline 'Article 101' + +# You can create saved objects in a single step +>>> a10 = Article.objects.create(headline="Article 10", pub_date=datetime(2005, 7, 31, 12, 30, 45)) +>>> Article.objects.get(headline="Article 10") +<Article: Article 10> """ |
