def getMany(self, *args, **kwargs):
        if isinstance(kls, basestring):
            # resolve it to a class
            realkls = string_to_obj(kls)
        else:
            realkls = kls
        eq = [EQ(FIELD(x), self[y]) for x, y in zipped]
        if args and isinstance(args[0], basestring):
            # combining a string requires awkward special casing...
            conn = self.getDBI()
            converter = conn.getConverter()
            sql, values = self._processWhere(conn, eq, {}, converter=converter)
            converter.reset()
            extrasql, extravalues = self._processWhere(conn, args, kwargs, converter=converter)
            # merge sql strings
            sql = " AND ".join((sql, extrasql))
            # merge values
            if isinstance(values, dict):
                if not isinstance(extravalues, dict):
                    raise ValueError, "expected dictionary of bind variables!"
                values.update(extravalues)
                newargs = (sql, values)
            else:
                values = tuple(values) + tuple(extravalues)
                newargs = (sql,) + values
            del converter
            return realkls.getSome(*newargs)

        else:
            return realkls.getSome(*(tuple(eq) + args), **kwargs)
Exemple #2
0
    def getMany(self, *args, **kwargs):
        if isinstance(kls, basestring):
            # resolve it to a class
            realkls = string_to_obj(kls)
        else:
            realkls = kls
        eq = [EQ(FIELD(x), self[y]) for x, y in zipped]
        if args and isinstance(args[0], basestring):
            # combining a string requires awkward special casing...
            conn = self.getDBI()
            converter = conn.getConverter()
            sql, values = self._processWhere(conn, eq, {}, converter=converter)
            converter.reset()
            extrasql, extravalues = self._processWhere(conn,
                                                       args,
                                                       kwargs,
                                                       converter=converter)
            # merge sql strings
            sql = ' AND '.join((sql, extrasql))
            # merge values
            if isinstance(values, dict):
                if not isinstance(extravalues, dict):
                    raise ValueError, "expected dictionary of bind variables!"
                values.update(extravalues)
                newargs = (sql, values)
            else:
                values = tuple(values) + tuple(extravalues)
                newargs = (sql, ) + values
            del converter
            return realkls.getSome(*newargs)

        else:
            return realkls.getSome(*(tuple(eq) + args), **kwargs)
 def getMany(self, *args, **kwargs):
     if isinstance(kls, basestring):
         # resolve it to a class
         realkls = string_to_obj(kls)
     else:
         realkls = kls
     return self.joinTable(
         this_side, pivot_table, this_pivot_side, that_pivot_side, realkls, that_side, *args, **kwargs
     )
Exemple #4
0
 def getMany(self, *args, **kwargs):
     if isinstance(kls, basestring):
         # resolve it to a class
         realkls = string_to_obj(kls)
     else:
         realkls = kls
     return self.joinTable(this_side, pivot_table, this_pivot_side,
                           that_pivot_side, realkls, that_side, *args,
                           **kwargs)
 def fget(self):
     if isinstance(self._kls, basestring):
         return string_to_obj(self._kls)
     return self._kls
Exemple #6
0
 def fget(self):
     if isinstance(self._kls, basestring):
         return string_to_obj(self._kls)
     return self._kls