Answers for "django get model from name"

2

django load model by name

from django.apps import apps
user = apps.get_model(app_label='auth', model_name='User')
# Can also support syntax like 'auth.User' passing a single parameter
user = apps.get_model('auth.User')
Posted by: Guest on July-13-2020

Code answers related to "django get model from name"

Python Answers by Framework

Browse Popular Code Answers by Language