self._data = self.key.hgetall()
+ def validate_changes(self, changes):
+ This is a callback that can be overridden to perform custom validation
+ on the structure. It is passed `changes`, which is a dictionary of
+ values to be changed. This is called **before** the changes are
+ committed, but after individual fields have been validated.
+ This should not modify the `changes` dictionary (if it does, it will
+ have no effect) and should not make any permanent changes to the
+ database state. It may raise `TypeError`, `ValueError`, or
+ `ValidationError` if there is a problem.
+ This is a callback that can be overridden to perform postprocessing
+ after the structure has been updated. It is passed no arguments. This
+ is called **after** the changes have already been committed and the
+ instance has been refreshed.
def update(self, _data=None, **kwargs):
Updates the given fields atomically. This will validate the fields,
converted = field.converter.to_redis(value)
pipe = self.key.client.pipeline(True)