Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(2)  |  Call(1)  |  Derive(0)  |  Import(1)

        def is_uniq_duplication(session, machine, plugin, plugin_selector, is_deleted=False):
    and_clause = and_()
    and_clause.append(Watch.machine_id == machine.id)
    and_clause.append(Watch.plugin == plugin)
    and_clause.append(Watch.plugin_selector == plugin_selector)
    and_clause.append(Watch.is_deleted == is_deleted)

    ret = session.query(Watch).filter(and_clause).all()

    if 1 <= len(ret):
        return True
    else:
        return False
        


src/k/a/karesansui-HEAD/karesansui/gadget/hostby1watch.py   karesansui(Download)
    CHECK_LENGTH, CHECK_MIN, CHECK_MAX
 
from karesansui.db.access.watch import \
    findbyall as w_findbyall, findby1 as w_findby1, \
    findby1name as w_findby1name, findbyname_or_plugin as w_findbyname_or_plugin, \
        machine = m_findby1(self.orm, host_id)
 
        if w_is_uniq_duplication(self.orm, machine, plugin, plugin_selector) is True:
            self.logger.debug("Set watch failed. Duplicate watch DB.")
            return web.badrequest("Set watch failed. Duplication watch")