how to get foregine key field from models

Solutions on MaxInterview for how to get foregine key field from models by the best coders in the world

showing results for - "how to get foregine key field from models"
Amy
11 Nov 2017
1>>> SubCategory._meta.get_field('category').remote_field.model.__name__ 
2>>> 'Category'
3