I have a model in Django in which I need to validate if a specific field has been updated, based on that I will perform an action, I would appreciate your help. the field that I want to validate is to assign, I just need to capture its value to compare it with the new value. I am aware that signals in django do what I need
class Insidencia(models.Model):
autor = models.ForeignKey(User)
categoria = models.ForeignKey(Categoria, on_delete=models.CASCADE)
asunto = models.CharField(verbose_name="Asunto", max_length=255)
fecha = models.DateTimeField(auto_now_add=True,blank=True)
descripcion = models.TextField(verbose_name="Descripcion")
URGENCIA = (
('FUERA DE SERVICIO','Fuera de Servicio'),
('OPERACION DEGRADA','Operacion Degradada'),
('FALLAS INTERMITENETE','Fallas Intermitente'),
('FALLAS NO GRAVE','Fallas no Grave'),
('FALLA OCASIONAL', 'Falla Ocasional'),
)
urgencia = models.CharField(verbose_name="Urgencia", choices=URGENCIA, max_length=50)
soluciion = models.TextField(verbose_name='Solucion', blank=True, null=True)
asignar = models.ForeignKey('Tecnico',blank=True ,null=True, on_delete=models.CASCADE)
ESTADO = (
('EN PROCESO', 'En Proceso'),
('RESUELTO','Resuelto'),
)
estado = models.CharField(verbose_name="Estado", choices=ESTADO, max_length=50, blank="True", default='EN PROCESO',)
class Meta:
verbose_name_plural = u'Insidencias'
def __encode__(self):
return self.asunto