Why does django keep telling me the app label doesn't exist when I use apps.get_model? -


i have following function...

def dostuffwithmodelinstance(model_instance):     name = model_instance.name     model = apps.get_model(name, name) 

where model_instance parameter passing in holds 2 values, name , description.

the name value name of model. when use

apps.get_model(name, name) 

i error saying app_label not exist....

however, if type out app_label soo....

apps.get_model('some_app_label', name) 

it works... how can make can pass in app_label variable?

seems there hidden characters being sent variable. specifically, new line character '\n'.


Comments