I want to do the following declare a variable that contains the name of the model and travez of those variables execute the queries on that model example model="Person" model.objects.all ()
I want to do the following declare a variable that contains the name of the model and travez of those variables execute the queries on that model example model="Person" model.objects.all ()
I would recommend you use a dictionary to help you, like this:
modelos = {
'persona': Persona,
'animal': Animal,
# ... otros modelos
}
modelo = 'persona' # esta sería la llave
modelos[modelo].objects.all()
I hope it's a great help