[Answered ]-Django calling another model's upload_to inside a model

2👍

That’s just very simple. Use _meta for this purpose. You can use get_field method to get the fields of the model like imageA in your case. Then access any attribute of that field using object notations.

upload_to_attr = ModelName._meta.get_field('foo').upload_to

more generic:

attr_value = ModelName._meta.get_field('foo').attr_name

Leave a comment