'Return a ToolVersionAssociation if one exists that associates the two
received tool_versions. This function is called only from Galaxy.'

def get_tool_version_association(self, parent_tool_version, tool_version):

    context = self.app.install_model.context
    return context.query(self.app.install_model.ToolVersionAssociation).filter(and_((self.app.install_model.ToolVersionAssociation.table.c.parent_id == parent_tool_version.id), (self.app.install_model.ToolVersionAssociation.table.c.tool_id == tool_version.id))).first()
