Hi,

How about telling us what are you trying to achieve by comparing to
previous state of the object?

On Sun, Jul 15, 2012 at 1:49 AM, Nicolas Emiliani <or3s...@gmail.com> wrote:

> Hi,
>
> Is there a way to access the state of a Model object prior to it's
> modification through a form ?
> Kind of a nasty question :S, let me explain.
>
> The thing is that if i use the save_model hook and the user modifies the
> model through the form,
> the obj parameter that I receive has already all the modifications loaded,
> so if  I have, let's say,
> a boolean attribute called "published"  and the user clicked published
> then :
>
> obj.published == True
>
> Is there a way to know which was the state of the model, in this case the
> state of obj.published,
> before the user clicked on the save button on the admin form ? or should I
> use a second model
> attribute and hide it on the form to keep the previous state ? is there a
> "Django" way to do this ?
>
> It's my first post, be gentle :P
>
> Thanks !
>
> --
> Nicolas Emiliani
>
> Lo unico instantaneo en la vida es el cafe, y es bien feo.
>
> --
> 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
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>



-- 
Jani Tiainen

- Well planned is half done, and a half done has been sufficient before...

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to