try:
old_user = User.objects.get(pk=self.pk)
# means update
except:
pass
2011/2/4 andmart <[email protected]>
> Hi,
>
> I overrided the save_model of ModelAdmin of model Client that is
> associated a one User so I can create a user when a client is created.
>
> Well, how to know if the save_model was called to do a update or a
> insert if the object already exists in database?
>
> Trying to see if model.pk exists fail.
>
> Thanks in advance.
>
> Andre
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<django-users%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected].
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.