Using value as SearchField hash_key makes Django want to always create a migration
I originally wrote this as a comment to #10 (closed) but perhaps it's an issue of its own.
If one provides the hash_key
to a search field for example from a setting:
fields.SearchField(
hash_key=settings.MY_SALT,
...
)
then Django puts the value of the setting into the migration file. One can off course edit the migration file by hand and change it to use the settings as well. But Django isn't satisfied with that. When running manage.py makemigrations
, Django still wants to create a new migration for this field.
In order to get around this we made a custom version that accepts a function (that returns the actual hash key) as the hash_key
.
If we make a PR of this, could it be merged?