I have a some fields in my model where I am trying to apply encryption on all the fields. Each field encryption depends on the values of two other fields in that same model class. I am able to achieve the encrypted data.
But I also need those two other fields in the same class to decrypt the other field values that is returned by the function def from_db_value(self, value, expression, connection, *args).
I have read the docs and source code, but I didn't see a proper explanation on the following parameters in from_db_value(self, value, expression, connection, *args):
expression*args
I want to know how and where we can supply these parameters. How else we can use that function. I know the function should return the value from database converted into an appropriate python object. But I want to know what else it can do or we can do with it?
P.S: Yes, I am trying to make custom field classes.
Inspiration: django-fernet-fields