Exemple #1
0
 def _call_set(self, command, value, *args, **kwargs):
     """
     Helper for commands that only set a value to the field.
     """
     if self.indexable:
         current = self.proxy_get()
         if normalize(current) != normalize(value):
             if current is not None:
                 self.deindex(current)
             if value is not None:
                 self.index(value)
     return self._traverse_command(command, value, *args, **kwargs)
Exemple #2
0
 def from_python(self, value):
     """
     Coerce a value before using it in Redis.
     """
     return normalize(value)