Inside the clean method you have access to self.instance.pk, which returns
true if there an instance (with an already established primary key) or false
if there isn't already an instance.

Hope that helps,

Michael

On Sun, Apr 6, 2008 at 5:44 PM, Petar <[EMAIL PROTECTED]> wrote:

>
> Dear someone,
>
> I have a ModelForm for my User (standard django) model. I want to
> check if the email is unique so I created a clean_email method which
> works fine. The only problem is that I only want to check the email
> address when it's changed.
>
> Is their a way to get the 'initial' value of the email formfield and
> only perform a check if it has changed?
>
> Thanks in advance,
> Pero
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to