예제 #1
0
파일: SAW.py 프로젝트: JPilarr/tapyr
 def _op_call(self, name, op, *args, **kw):
     akw = self._akw
     if self._field or name not in akw.op_map:
         return self.__super._op_call(name, op, *args, **kw)
     else:
         cidr_op = akw.op_map[name]
         op_proxy = _QX_Call_Proxy_(self, akw, name, cidr_op(akw))
         return QX.Call(self, name, op_proxy, *args, **kw)
예제 #2
0
파일: SAW.py 프로젝트: JPilarr/tapyr
 def _op_bin(self, rhs, name, op, reverse):
     akw = self._akw
     if self._field or name not in akw.op_map:
         return self.__super._op_bin(rhs, name, op, reverse)
     else:
         cidr_op = akw.op_map[name]
         op_proxy = _QX_Bin_Proxy_(self, akw, name, cidr_op(akw))
         return QX.Bin(self, name, op_proxy, rhs, reverse)
예제 #3
0
 def _op_call (self, name, op, * args, ** kw) :
     akw = self._akw
     if name not in akw.op_map :
         return self.__super._op_call (name, op, * args, ** kw)
     else :
         op_getter = akw.op_map [name]
         op_name   = op_getter  (akw)
         op_proxy  = _QX_Call_Proxy_ (self, akw, name, op_name)
         result    = QX.Call (self, name, op_proxy, * args, ** kw)
         return result
예제 #4
0
 def _op_bin (self, rhs, name, op, reverse) :
     akw = self._akw
     if name not in akw.op_map :
         return self.__super._op_bin (rhs, name, op, reverse)
     else :
         op_getter = akw.op_map [name]
         op_name   = op_getter  (akw)
         op_proxy  = _QX_Bin_Proxy_ (self, akw, name, op_name)
         result    = QX.Bin (self, name, op_proxy, rhs, reverse)
         return result
예제 #5
0
def show_joins(apt, ET, q):
    qr = apt.DBW.PNS.Q_Result.E_Type(apt[ET], _strict=False)
    qx = QX.Mapper(qr)(q)
    try:
        qx.XS_FILTER  ### might trigger additional joins
    except Exception:
        pass
    print(ET, " : ", q)
    for j in qx.JOINS:
        print \
            ( " ", "%-5.5s" % j.joiner.__name__.upper ()
            , " = ".join (str (c) for c in j.cols)
            )
예제 #6
0
파일: Q_Result.py 프로젝트: JPilarr/tapyr
 def _get_xs (self, criteria, sa_query, xs_name, adder) :
     QX     = self.QX
     joined = self._joined
     join   = orig_join = sa_query.froms [-1]
     xs     = []
     for c in criteria :
         if isinstance (c, SA.Operators) :
             xs.append (c)
         elif c is not None :
             qx   = QX.Mapper (self) (c)
             x    = getattr (qx, xs_name)
             join = self._extend_join (join, joined, qx.JOINS)
             adder (xs, x)
     return xs, None if join is orig_join else join
예제 #7
0
def show_xs_filter(apt, ET, q):
    qr = apt.DBW.PNS.Q_Result.E_Type(apt[ET], _strict=False)
    qx = QX.Mapper(qr)(q)
    print(ET, " : ", q)
    print("   ", qx.XS_FILTER)
예제 #8
0
def show_qx(qx, level=0):
    print(QX.display(qx, level=0))
예제 #9
0
def show_columns(apt, ET, q):
    qr = apt.DBW.PNS.Q_Result.E_Type(apt[ET], _strict=False)
    qx = QX.Mapper(qr)(q)
    print("QX." + qx.__class__.__name__, ET, " : ", q)
    for c in qx._columns:
        print(" ", c)
예제 #10
0
def show_qx (qx, level = 0) :
    print (QX.display (qx, level = 0))