diff --git a/iati_datastore/iatilib/frontend/dsfilter.py b/iati_datastore/iatilib/frontend/dsfilter.py index bced2093..3ddf200b 100644 --- a/iati_datastore/iatilib/frontend/dsfilter.py +++ b/iati_datastore/iatilib/frontend/dsfilter.py @@ -361,7 +361,12 @@ def transactions_by_sector(args): return _filter( db.session.query(Transaction, SectorPercentage) .join(Activity, Activity.iati_identifier==Transaction.activity_id) - .join(SectorPercentage), + .join(SectorPercentage) + .options( + orm.selectinload(Transaction.recipient_country_percentages), + orm.selectinload(Transaction.recipient_region_percentages), + orm.selectinload(Transaction.sector_percentages), + ), args )