def get_account_by_id(account_id):
 account = Account.query.filter((Account.id == account_id)).first()
 manager_class = account_registry.get(account.account_type.name)
 account = manager_class()._load(account)
 db.session.expunge(account)
 return account

def get_account_by_id ( account_id ) : account = Account . query . filter ( ( Account . id == account_id ) ) . first ( ) manager_class = account_registry . get ( account . account_type . name ) account = manager_class ( ) . _load ( account ) db . session . expunge ( account ) return account
retrieves an account plus any additional custom fields .