My problem is with editing model fields in admin interface. The model has encrypted keys and I have already done a form for a user who has logged in can edit their model/keys in the website.
Now, I want to have admin be possible to edit these same keys too in the admin interface. This requires that the keys has to be encrypted first before saving them in the database.
I have my model in admin interface with code in admin.py:
admin.site.register(CryptedKeysModel)
I get shown a encrypted fields now, but if I edit any field, it isn't encrypted. I do the encryption in the views when it's showed for user in website, but where I should do the encryption, when I'm saving fields in admin interface? I guess in the models.py (?)
savemethod of the model.