- q = projectB.query("""SELECT origin.package, origin.priority,
- origin.section, origin.maintainer, target.priority,
- target.section, target.maintainer FROM override origin LEFT
- JOIN override target ON (origin.package = target.package AND
- target.suite=%s AND origin.component = target.component AND
- origin.type = target.type) WHERE origin.suite = %s AND
- origin.component = %s AND origin.type = %s""" % (osuite_id,
- originosuite_id, component_id, type_id))
- for i in q.getresult():
+ q = session.execute("""SELECT origin.package, origin.priority, origin.section,
+ origin.maintainer, target.priority, target.section,
+ target.maintainer
+ FROM override origin LEFT JOIN override target
+ ON (origin.package = target.package
+ AND target.suite = :suite_id
+ AND origin.component = target.component
+ AND origin.type = target.type)
+ WHERE origin.suite = :originsuite_id
+ AND origin.component = :component_id
+ AND origin.type = :type_id""",
+ {'suite_id': osuite_id, 'originsuite_id': originosuite_id,
+ 'component_id': component_id, 'type_id': type_id})
+ for i in q.fetchall():