覆盖加密数据的django-admin编辑表单字段值 [英] Override django-admin edit form field values for encrypted data
本文介绍了覆盖加密数据的django-admin编辑表单字段值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
解决方案
可以覆盖您使用的模型形式modeladmin (docs),在这种情况下我会考虑使用自定义字段类型,并加密加密/解密成数据库序列化/反序列化
I have values in a database that are encrypted, how can I override django's admin edit form so that the fields can display the decrypted data? Just to clarify I know how to decrypt the values I just need to know how to get the decrypted values into the fields. Is there a django signal for the change_view method that I could perhaps use?
解决方案
while it's possible to override the modelform used by your modeladmin (docs), in this case i would consider using a custom field type, and building in the encryption/decryption into the database serialisation/deserialisation
这篇关于覆盖加密数据的django-admin编辑表单字段值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文