mirror of
https://github.com/django/django.git
synced 2025-09-18 00:10:22 +00:00
Fixed #757: manually set AutoField values are now respected; also added unit test to verify the correct behavior. Thanks, cygnus.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@1511 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
bf0f6ec3b4
commit
c28daf2289
3 changed files with 14 additions and 3 deletions
|
@ -157,6 +157,14 @@ datetime.datetime(2005, 7, 31, 12, 30, 45)
|
|||
>>> a8.save()
|
||||
>>> a8.id
|
||||
8L
|
||||
|
||||
# You can manually specify the primary key when creating a new objet
|
||||
>>> a101 = articles.Article(id=101, headline='Article 101', pub_date=datetime(2005, 7, 31, 12, 30, 45))
|
||||
>>> a101.save()
|
||||
>>> a101 = articles.get_object(pk=101)
|
||||
>>> a101.headline
|
||||
'Article 101'
|
||||
|
||||
"""
|
||||
|
||||
from django.conf import settings
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue