incuna/django-pgcrypto-fields — pull request #4 by KevinEtienne (2014-10-28 17:25:10+00:00)
Title: As an enhancement is it possible to also decrypt in python?

This could work similar to https://github.com/incuna/django-field-cryptography/blob/master/django_field_cryptography/fields.py but using pgp decryption with the private key from settings.

Alternatively the `to_python` could return an object that included an accessor that decrypted the value when needed. You could have something like `myModel.encrypted_field.decrypt` to get the decrypted value and `myModel.encrypted_field` would return the raw encrypted value (as it would currently).

This would avoid the need to use the aggregate when only selecting a single item,