'Return a query containing repositories for resetting metadata.  The order parameter
is used for displaying the list of repositories ordered alphabetically for display on
a page.  When called from the Galaxy API, order is False.'

def get_query_for_setting_metadata_on_repositories(self, order=True):

    if order:
        return self.app.install_model.context.query(self.app.install_model.ToolShedRepository).filter((self.app.install_model.ToolShedRepository.table.c.uninstalled == false())).order_by(self.app.install_model.ToolShedRepository.table.c.name, self.app.install_model.ToolShedRepository.table.c.owner)
    else:
        return self.app.install_model.context.query(self.app.install_model.ToolShedRepository).filter((self.app.install_model.ToolShedRepository.table.c.uninstalled == false()))
