On Mon, Jul 30, 2012 at 6:22 PM, Tomas Neme wrote:
>
> uhm, if you register a listener to the pre_save signal, then you can do
> this:
>
>
> if instance.published:
> # the instance about to be saved has the published flag on
> dbojb = MyModel.objects.get(id=instance.id)
>
> # did it have it
uhm, if you register a listener to the pre_save signal, then you can do
this:
if instance.published:
# the instance about to be saved has the published flag on
dbojb = MyModel.objects.get(id=instance.id)
# did it have it on the database?
if not dbobj.published:
do_stuff()
you probab
This is a long shot but try checking out django-reversion
>
Sounds interesting.
> thank you.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/NM3
Hello,
This is a long shot but try checking out django-reversion
thank you.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/django-users/-/NM39pkUyvG4J.
To post to this
On 15-7-2012 0:49, Nicolas Emiliani wrote:
> 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 ?
Set the form field of the ModelAdmin to a custom form that de
s nothing to do
>> with that attribute ? I would be
>> republishing only if it's previous state was not published. But how can I
>> acces that previous state ?
>>
>> Sounds waky :P
>>
>>
>>
>>> On Sun, Jul 15, 2012 at 1:49 AM, Nicolas Emiliani
ied some other field that has nothing to do
> with that attribute ? I would be
> republishing only if it's previous state was not published. But how can I
> acces that previous state ?
>
> Sounds waky :P
>
>
>
>> On Sun, Jul 15, 2012 at 1:49 AM, Nicolas Emili
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
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 wrote:
> Hi,
>
> Is there a way to access the state of a Model object prior to it's
> modification through a form ?
> Kind
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 al
10 matches
Mail list logo