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
This commit is contained in:
Jacob Kaplan-Moss 2006-06-27 20:36:25 +00:00
parent 2adbe11678
commit 48562965b9
4 changed files with 37 additions and 2 deletions

View file

@ -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>
"""