RadiantHex
RadiantHex

Reputation: 25577

Admin search not working for my fields - Django

I have a model with an encrypted field.

So fields are encrypted and decrypted as they enter and leave the database.


The problem:

within the admin panel


Any ideas? :)

Upvotes: 0

Views: 948

Answers (1)

Bernhard Vallant
Bernhard Vallant

Reputation: 50796

If I understand your question correctly you would have to encrypt the search term as well to fit to the entries in the database. This will most probably fail with the standard admin functionality, since all the fields specified as search fields will be handled in the same fashion. You would have to create your own ChangeList class and override its get_query_set method, so that it can handle your field in a special way!

Upvotes: 1

Related Questions