Beispiel #1
0
 def delete(self, *keys):
     return fn.delete(self, Passthrough(list(keys)))
Beispiel #2
0
 def contains_all(self, *keys):
     return Expression(
         self.as_json(True),
         OP.JSONB_CONTAINS_ALL_KEYS,
         Passthrough(list(keys)))
Beispiel #3
0
 def slice(self, *args):
     return fn.slice(self, Passthrough(list(args)))
Beispiel #4
0
 def contains_all(self, *items):
     return Expression(
         self,
         OP.JSONB_CONTAINS_ALL_KEYS,
         Passthrough(list(items)))
Beispiel #5
0
 def contains_any(self, *items):
     return Expression(
         self,
         OP.JSONB_CONTAINS_ANY_KEY,
         Passthrough(list(items)),)
Beispiel #6
0
 def contains(self, other):
     if isinstance(other, (list, dict)):
         return Expression(self, OP.JSONB_CONTAINS, Json(other))
     return Expression(self, OP.JSONB_EXISTS, Passthrough(other))
Beispiel #7
0
 def contains_any(self, *keys):
     return Expression(self, OP.HCONTAINS_ANY_KEY, Passthrough(list(keys)))
Beispiel #8
0
 def contains(self, value):
     if isinstance(value, dict):
         return Expression(self, OP.HCONTAINS_DICT, Passthrough(value))
     elif isinstance(value, (list, tuple)):
         return Expression(self, OP.HCONTAINS_KEYS, Passthrough(value))
     return Expression(self, OP.HCONTAINS_KEY, value)