You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a field on my model of type string, that I need to encrypt within the db, and was looking for a clean way to implement this in the model, to avoid having to encrypt/decrypt within my business logic.
What is the best way to achieve this, I had looked at a few options for implicitly encrypting/decrypting
Override serialise/deserialise on the model
Have a custom field type that extends pydbantics ModelField
Make use of pydantics hooks for this
Something else?
I'm looking for some guidance on the best approach here in terms of maintainability and simplicity. Thanks
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have a field on my model of type string, that I need to encrypt within the db, and was looking for a clean way to implement this in the model, to avoid having to encrypt/decrypt within my business logic.
What is the best way to achieve this, I had looked at a few options for implicitly encrypting/decrypting
I'm looking for some guidance on the best approach here in terms of maintainability and simplicity. Thanks
Beta Was this translation helpful? Give feedback.
All reactions