Is there a reason this needs to be done with isinstance checks (therefore requiring the imports)? Couldn't this be handled by the __repr__ or __str__ method on obj itself? That way, you can put *any* obj into the error/warning, not just the officially blessed set of Field or Model.