code: def _setup_validation(self, sender, **kwargs):
          
          att_name = self.get_attname()
          private_att_name = '_enum_%s' % att_name
          enum = self.enum
  
          def set_enum(self, new_value):
              if hasattr(self, private_att_name):
                  # Fetch previous value from private enum attribute.
                  old_value = getattr(self, private_att_name)
              else:
                  # First setattr no previous value on instance.
                  old_value = new_value
              # Update private enum attribute with new value
              setattr(self, private_att_name, new_value)
              self.__dict__[att_name] = new_value
              # Run validation for new value.
              validators.validate_valid_transition(enum, old_value, new_value)
  
          def get_enum(self):
              return getattr(self, private_att_name)
  
          def delete_enum(self):
              self.__dict__[att_name] = None
              return setattr(self, private_att_name, None)
  
          if not sender._meta.abstract:
              setattr(sender, att_name, property(get_enum, set_enum, delete_enum))
docs: User a customer setter for the field to validate new value against the old one.
          The current value is set as '_enum_[att_name]' on the model instance.