我应该如何理解这一点?以及这会如何发生? 走进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