Ticket #2259: pk_change.diff
File pk_change.diff, 685 bytes (added by , 17 years ago) |
---|
-
tests/modeltests/basic/models.py
384 384 >>> a.save() 385 385 >>> Article.objects.get(pk=a.id).headline 386 386 u'\u6797\u539f \u3081\u3050\u307f' 387 388 # It is possible to change primary key value 389 >>> bc = Article(headline="primary changed article", pub_date=datetime(2008, 1, 1)) 390 >>> bc.save() 391 >>> total = Article.objects.all().count() 392 393 # After changing primary key value we still have same number of objects 394 >>> bc.id = 999 395 >>> bc.save() 396 >>> print total == Article.objects.all().count() 397 True 387 398 """