예제 #1
0
파일: base.py 프로젝트: mijdavis2/weppy
 def where(self, query, ignore_common_filters=False, model=None):
     if query is None:
         return self
     elif isinstance(query, Table):
         query = self.db._adapter.id_query(query)
     elif isinstance(query, str):
         query = Expression(self.db, query)
     elif isinstance(query, Field):
         query = query != None
     q = self.query & query if self.query else query
     return Set(
         self.db, q, ignore_common_filters=ignore_common_filters,
         model=model)
예제 #2
0
 def where(self, query, ignore_common_filters=None, model=None):
     if query is None:
         return self
     elif isinstance(query, Table):
         query = self.db._adapter.id_query(query)
     elif isinstance(query, str):
         query = Expression(self.db, query)
     elif isinstance(query, Field):
         query = query != None
     elif isinstance(query, types.LambdaType):
         model = model or self._model_
         if not model:
             raise ValueError(
                 "Too many models involved in the Set to use a lambda")
         query = query(model)
     q = self.query & query if self.query else query
     return self._clone(ignore_common_filters, model, query=q)
예제 #3
0
 def cast(self, value, **kwargs):
     return Expression(self.db, self._dialect.cast, self,
                       self._dialect.types[value] % kwargs, value)
예제 #4
0
 def _jpathv_expr(self, expr, data):
     return Expression(expr.db, self._jpathv, expr, data, 'string')
예제 #5
0
 def _jpath_expr(self, expr, data):
     return Expression(expr.db, self._jpath, expr, data, expr.type)
예제 #6
0
 def _jget_expr(self, expr, data):
     return Expression(expr.db, self._jget, expr, data, expr.type)