Using __getattr__ with SQLAlchemy ORM leads to RecursionError Simple self-contained example below, presupposing SQLite.