I think the problem here is because jet is trying to use related_model in the RelatedFieldAjaxListFilter.field_choices() method, and this can be done before all applications are loaded. If I understand correctly, the value of related_model initially a string, which is replaced by a model object during the initialization of the model. If you try to get this value before all applications are loaded, you can get a string or object, depending on the loading order of the models. And, since this is a caching property, getting the string value at this point will result in the string value being cached. See, for example, the comment in django.db.models.options ,
By making related_name unencrypted property, you avoid this problem.
In the django.contrib.admin.filters.RelatedFieldListFilter code django.contrib.admin.filters.RelatedFieldListFilter they DO NOT use the related_model to get the model object, but instead use the django.contrib.admin.utils.get_model_from_relation() utility function. Probably RelatedFieldAjaxListFilter.field_choices() should do something similar.
molecule
source share