I am not sure if I it is possible to do what I want to do. Consider the following two lines.
document_type = 'Book'
documents = bookModel.document_type.objects.all()
document_type can be 'Book', 'Magazine', 'Essay' etc.
I don't want to have to write an if sentence for each type like this :
if document_type == 'Book':
documents = bookModel.Book.objects.all()
Can I somehow make it work like the first two lines of code ?