Clean up SQLAlchemy function call
Clean up SQLAlchemy function call

Replaced filter commands with joins and compressed
the syntax so it's more readable.
Logic is unchanged.

alphagov/digitalmarketplace-api,alphagov/digitalmarketplace-api,alphagov/digitalmarketplace-api