Made the get_container support both subclasses of ModelWithInheritance and models without inheritance.