mirror of
https://github.com/django/django.git
synced 2025-08-04 10:59:45 +00:00
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:
parent
2adbe11678
commit
48562965b9
4 changed files with 37 additions and 2 deletions
|
@ -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>
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue