Answers for "how to get foregine key field from models"

0

how to get foregine key field from models

>>> SubCategory._meta.get_field('category').remote_field.model.__name__ 
>>> 'Category'
Posted by: Guest on January-12-2021

Code answers related to "how to get foregine key field from models"

Python Answers by Framework

Browse Popular Code Answers by Language