Re: form.has_changed always true?

2010-02-26 Thread Jirka Vejrazka
Hi, if I digress from the has_changed() problem, you mentioned you wanted to send email after a user profile has changed. Assuming that the profile is a model in the database, you might consider tying your logic to the model rather than the form. The post_save signal tied to the

Re: form.has_changed always true?

2010-02-25 Thread Karen Tracey
On Thu, Feb 25, 2010 at 3:03 PM, ducu wrote: > Btw, has_changed() doesn't seem to work on non-model forms, does it? > > Yes, it does: >>> from django import forms >>> class AForm(forms.Form): ... x = forms.IntegerField() ... >>> af = AForm({'x': u'1'},

Re: form.has_changed always true?

2010-02-25 Thread ducu
Btw, has_changed() doesn't seem to work on non-model forms, does it? On Jan 12, 12:43 am, Alastair Campbell wrote: > On Fri, Jan 8, 2010 at 1:09 AM, Karen Tracey wrote: > > Using the instance parameter is the POST leg also allows you to simply > > save()

Re: form.has_changed always true?

2010-01-11 Thread Alastair Campbell
On Fri, Jan 8, 2010 at 1:09 AM, Karen Tracey wrote: > Using the instance parameter is the POST leg also allows you to simply > save() the form to get the changes to the instance saved.  There is then no > need to individually copy each of the fields from the form's

Re: form.has_changed always true?

2010-01-07 Thread Karen Tracey
On Thu, Jan 7, 2010 at 7:14 PM, Alastair Campbell wrote: > > I've put the model form definition and the view up here: > http://dpaste.com/142308/ > > Any idea what I'm doing wrong? Perhaps something to do with loading > the form with data in the first place? > > You want to

Re: form.has_changed always true?

2010-01-07 Thread Alastair Campbell
Hi Margie, Thanks for the tip, when I do that, every filled-in field is returned as changed. I've put the model form definition and the view up here: http://dpaste.com/142308/ Any idea what I'm doing wrong? Perhaps something to do with loading the form with data in the first place? Kind

Re: form.has_changed always true?

2010-01-06 Thread Margie Roginski
If you look at the form's _changed_data attribute, it will give you a list of the fields that have changed. That should tell you what is causing has_changed() to return True. Margie On Jan 6, 6:50 pm, Karen Tracey wrote: > On Wed, Jan 6, 2010 at 7:34 PM, Alastair Campbell

Re: form.has_changed always true?

2010-01-06 Thread Karen Tracey
On Wed, Jan 6, 2010 at 7:34 PM, Alastair Campbell wrote: > Hi everyone, > > I've been looking for a simple way to send an email when a user > updates their profile. > > After some digging I found form.has_changed() which appears to fit the > bill. However, it always seems to

form.has_changed always true?

2010-01-06 Thread Alastair Campbell
Hi everyone, I've been looking for a simple way to send an email when a user updates their profile. After some digging I found form.has_changed() which appears to fit the bill. However, it always seems to return true, so I could end up bombarding our elderly admin lady with lots of useless