dataimport/importer.py
changeset 10939 b30c2f49da57
parent 10809 359cbdf3a515
child 11275 814f54d6183b
--- a/dataimport/importer.py	Mon Nov 30 10:18:22 2015 +0100
+++ b/dataimport/importer.py	Mon Nov 30 11:09:51 2015 +0100
@@ -83,15 +83,15 @@
 
     def __init__(self, cnx, source=None):
         self.cnx = cnx
-        self._rql_template = 'Any S,O WHERE S {} O'
+        self._rql_template = 'Any S,O WHERE S %s O'
         self._kwargs = {}
         if source is not None:
-            self._rql_template += ', S cw_source SO, O cw_source SO, SO eid %(s)s'
+            self._rql_template += ', S cw_source SO, O cw_source SO, SO eid %%(s)s'
             self._kwargs['s'] = source.eid
 
     def __getitem__(self, rtype):
         """Return a set of (subject, object) eids already related by `rtype`"""
-        rql = self._rql_template.format(rtype)
+        rql = self._rql_template % rtype
         return set(tuple(x) for x in self.cnx.execute(rql, self._kwargs))