Пример #1
0
 def fetch_unnotified(cls, db):
     sql = cls._get_select_stem()
     condition = AndCondition([
         StrictEqualCondition(sql, 'completed', True),
         StrictEqualCondition(sql, 'notified', False),
     ])
     sql.set_where(condition)
     return cls._select(db, sql)
Пример #2
0
 def fetch_by_watch_and_changelist(cls, db, watch, changelist):
     sql = cls._get_select_stem()
     sql.set_where(
         AndCondition([
             StrictEqualCondition(sql, 'watch_id', watch.id),
             StrictEqualCondition(sql, 'changelist', changelist),
         ]))
     rows = cls._select(db, sql)
     return rows[0] if len(rows) >= 1 else None
Пример #3
0
 def fetch_by_watch(cls, db, watch):
     sql = Select('p4_paths_for_watch')
     sql.add_hidden_column('watch_id', IntColumnFormatter())
     sql.add_column('path_id', IntColumnFormatter())
     sql.add_column('path', StringColumnFormatter())
     sql.set_where(StrictEqualCondition(sql, 'watch_id', watch.id))
     return cls._select(db, sql)
Пример #4
0
 def fetch_by_overtest_testrun_id(cls, db, overtest_testrun_id):
     sql = cls._get_select_stem()
     sql.set_where(
         StrictEqualCondition(sql, 'overtest_testrun_id',
                              overtest_testrun_id))
     rows = cls._select(db, sql)
     return rows[0] if len(rows) >= 1 else None
Пример #5
0
 def fetch_by_subscriber(cls, db, user):
     sql = Select('bld_watches_for_subscriber')
     sql.add_hidden_column('subscriber_id', IntColumnFormatter())
     sql.add_column('watch_id', IntColumnFormatter())
     sql.add_column('name', StringColumnFormatter())
     sql.set_where(StrictEqualCondition(sql, 'subscriber_id', user.id))
     return cls._select(db, sql)
Пример #6
0
 def fetch_by_watch(cls, db, watch):
     sql = Select('bld_subscribers_for_watch')
     sql.add_hidden_column('watch_id', IntColumnFormatter())
     sql.add_column('subscriber_id', IntColumnFormatter())
     sql.add_column('email', StringColumnFormatter())
     sql.set_where(StrictEqualCondition(sql, 'watch_id', watch.id))
     return cls._select(db, sql)
Пример #7
0
 def fetch_by_path(cls, db, path):
     sql = cls._get_select_stem()
     sql.set_where(StrictEqualCondition(sql, 'path', path))
     rows = cls._select(db, sql)
     return rows[0] if len(rows) >= 1 else None
Пример #8
0
 def fetch_unsubmitted(cls, db):
     sql = cls._get_select_stem()
     sql.set_where(StrictEqualCondition(sql, 'overtest_testrun_id', None))
     rows = cls._select(db, sql)
     return rows
Пример #9
0
 def _get_primary_key_condition(self, sql):
     return AndCondition([
         StrictEqualCondition(sql, 'changelist', self.changelist),
         StrictEqualCondition(sql, 'watch_id', self.watch_id)
     ])
Пример #10
0
 def fetch_incomplete(cls, db):
     sql = cls._get_select_stem()
     sql.set_where(StrictEqualCondition(sql, 'completed', False))
     return cls._select(db, sql)
Пример #11
0
 def fetch_by_id(cls, db, id_):
     sql = cls._get_select_stem()
     sql.set_where(StrictEqualCondition(sql, 'id', id_))
     rows = cls._select(db, sql)
     return rows[0] if len(rows) >= 1 else None
Пример #12
0
 def _get_primary_key_condition(self, sql):
     return StrictEqualCondition(sql, 'id', self.id)
Пример #13
0
 def _get_primary_key_condition(self, sql):
     return AndCondition([
         StrictEqualCondition(sql, 'watch_id', self.watch_id),
         StrictEqualCondition(sql, 'path_id', self.path_id)
     ])
Пример #14
0
 def fetch_by_name(cls, db, name):
     sql = cls._get_select_stem()
     sql.set_where(StrictEqualCondition(sql, 'name', name))
     rows = cls._select(db, sql)
     return rows[0] if len(rows) >= 1 else None
Пример #15
0
 def fetch_by_email(cls, db, email):
     sql = cls._get_select_stem()
     sql.set_where(StrictEqualCondition(sql, 'email', email))
     rows = cls._select(db, sql)
     return rows[0] if len(rows) >= 1 else None
Пример #16
0
 def fetch_by_fqdn(cls, db, fqdn):
     sql = cls._get_select_stem()
     sql.set_where(StrictEqualCondition(sql, 'fqdn', fqdn))
     config = cls._select(db, sql)
     return config[0] if len(config) >= 1 else None