def extra_host_filters(multiple_labels=()):
 extra_args = {}
 where_str = 'afe_hosts.id in (select host_id from afe_hosts_labels where label_id=%s)'
 extra_args['where'] = ([where_str] * len(multiple_labels))
 extra_args['params'] = [models.Label.smart_get(label).id for label in multiple_labels]
 return extra_args

def extra_host_filters ( multiple_labels = ( ) ) : extra_args = { } where_str = 'afe_hosts.id in (select host_id from afe_hosts_labels where label_id=%s)' extra_args [ 'where' ] = ( [ where_str ] * len ( multiple_labels ) ) extra_args [ 'params' ] = [ models . Label . smart_get ( label ) . id for label in multiple_labels ] return extra_args
generate sql where clauses for matching hosts in an intersection of labels .