我應該如何理解這一點?以及這會如何發生? 走進Django的外殼:在django模型中保存數據實際上並不節省
>>> from customauth.models import Profile
>>> p = Profile.objects.get(user_id=1)
>>> p.status
u'34566'
>>> p.status = 'qwerty'
>>> p.status
'qwerty'
>>> p.save()
>>> p.status
'qwerty'
>>> p = Profile.objects.get(user_id=1)
>>> p.status
u'qwerty'
>>>
退出,再次進入運行Django shell:
>>> from customauth.models import Profile
>>> p = Profile.objects.get(user_id=1)
>>> p.status
u'qwerty'
>>>
似乎一切都OK。但現在進入dbshell:
mysql> select user_id, status from customauth_profile where user_id=1;
+---------+--------+
| user_id | status |
+---------+--------+
| 1 | 34566 |
可能很重要:我使用django.contrib.gis.db.backends.mysql後端數據庫(需要djagno_cities應用程序)和託管在亞馬遜上的項目,其GPL MySQL RDS作爲數據庫。 – 2013-02-12 11:05:48