summaryrefslogtreecommitdiff
path: root/tests/testapp/models/basic.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/testapp/models/basic.py')
-rw-r--r--tests/testapp/models/basic.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/testapp/models/basic.py b/tests/testapp/models/basic.py
index ad2a8cb862..80c264db86 100644
--- a/tests/testapp/models/basic.py
+++ b/tests/testapp/models/basic.py
@@ -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