1👍
✅
You can work with:
ModelB.target.field.related_model
or for a modelb_instance
:
type(modelb_instance).target.field.related_model
or we can work through the Options
of ModelB
with:
modelb_instance._meta.get_field('target').related_model
Source:stackexchange.com