Saving model object in django throws no error but attribute value doesn't change
Posted
by Pilgrim
on Stack Overflow
See other posts from Stack Overflow
or by Pilgrim
Published on 2010-04-11T23:41:50Z
Indexed on
2010/04/11
23:53 UTC
Read the original article
Hit count: 264
Hi.
I get a model object, change an attribute, save it and it still has the old attribute:
>>> g = SiteProfile.objects.get(pk=3)
>>> g.renew_date
datetime.date(2010, 4, 11)
>>> g.renew_date = date.today()+timedelta(days=365)
>>> g.renew_date
datetime.date(2011, 4, 11)
>>> g.save()
>>> g.renew_date
datetime.datetime(2010, 4, 11, 16, 57, 4, 192684)
Anyone know if this is an issue with the database or something else?
© Stack Overflow or respective owner