I have a status field which has 3 values: pending, activated
and rejected. If I am changing the value of status I want to
have a check that activated cannot be changed to pending. I
do not want to write stored-procs for this. Can I have the
previous value in Django before saving?
Means new and old value.
This method is to be added in a
Formsubclass. Its name isclean_FIELD_NAME.cleaned_datacontains previous values. New value is stored inself.instance.Alternatively,
validate()method can be added to aforms.Fieldsubclass. See Django documentation.