<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def save(self, value, redis, *, commit=True):
        ''' Sets this fields value in the databse '''
        value = self.prepare(value)

        if value is not None:
            redis.hset(self.obj.key(), self.name, value)
        else:
            redis.hdel(self.obj.key(), self.name)

        if self.index:
            key = self.key()

            if self.name in self.obj._old:
                redis.hdel(key, self.obj._old[self.name])

            if value is not None:
                redis.hset(key, value, self.obj.id)