@pick_context_manager_reader
def aggregate_get_by_metadata_key(context, key):
 query = model_query(context, models.Aggregate)
 query = query.join('_metadata')
 query = query.filter((models.AggregateMetadata.key == key))
 query = query.options(contains_eager('_metadata'))
 query = query.options(joinedload('_hosts'))
 return query.all()

@ pick_context_manager_reader def aggregate_get_by_metadata_key ( context , key ) : query = model_query ( context , models . Aggregate ) query = query . join ( '_metadata' ) query = query . filter ( ( models . AggregateMetadata . key == key ) ) query = query . options ( contains_eager ( '_metadata' ) ) query = query . options ( joinedload ( '_hosts' ) ) return query . all ( )
return rows that match metadata key .