@@ -1115,7 +1115,7 @@ def endswith(self, word):
1115
1115
1116
1116
@fluent
1117
1117
def iterable (self , iterable_name , * , collection , word , attribute = None , func = None ,
1118
- operation = None ):
1118
+ operation = None , negate = False ):
1119
1119
""" Performs a filter with the OData 'iterable_name' keyword
1120
1120
on the collection
1121
1121
@@ -1134,6 +1134,7 @@ def iterable(self, iterable_name, *, collection, word, attribute=None, func=None
1134
1134
the collection
1135
1135
:param str operation: the logical operation to apply to the attribute
1136
1136
inside the collection
1137
+ :param bool negate: negate the funcion or operation inside the iterable
1137
1138
:rtype: Query
1138
1139
"""
1139
1140
@@ -1156,9 +1157,9 @@ def iterable(self, iterable_name, *, collection, word, attribute=None, func=None
1156
1157
attribute = 'a/{}' .format (attribute )
1157
1158
1158
1159
if func is not None :
1159
- sentence = self ._prepare_function (func , attribute , word )
1160
+ sentence = self ._prepare_function (func , attribute , word , negate )
1160
1161
else :
1161
- sentence = self ._prepare_sentence (attribute , operation , word )
1162
+ sentence = self ._prepare_sentence (attribute , operation , word , negate )
1162
1163
1163
1164
filter_str , attrs = sentence
1164
1165
@@ -1170,7 +1171,7 @@ def iterable(self, iterable_name, *, collection, word, attribute=None, func=None
1170
1171
return self
1171
1172
1172
1173
@fluent
1173
- def any (self , * , collection , word , attribute = None , func = None , operation = None ):
1174
+ def any (self , * , collection , word , attribute = None , func = None , operation = None , negate = False ):
1174
1175
""" Performs a filter with the OData 'any' keyword on the collection
1175
1176
1176
1177
For example:
@@ -1188,14 +1189,16 @@ def any(self, *, collection, word, attribute=None, func=None, operation=None):
1188
1189
inside the collection
1189
1190
:param str operation: the logical operation to apply to the
1190
1191
attribute inside the collection
1192
+ :param bool negate: negate the funcion or operation inside the iterable
1191
1193
:rtype: Query
1192
1194
"""
1193
1195
1194
1196
return self .iterable ('any' , collection = collection , word = word ,
1195
- attribute = attribute , func = func , operation = operation )
1197
+ attribute = attribute , func = func , operation = operation ,
1198
+ negate = negate )
1196
1199
1197
1200
@fluent
1198
- def all (self , * , collection , word , attribute = None , func = None , operation = None ):
1201
+ def all (self , * , collection , word , attribute = None , func = None , operation = None , negate = False ):
1199
1202
""" Performs a filter with the OData 'all' keyword on the collection
1200
1203
1201
1204
For example:
@@ -1213,11 +1216,13 @@ def all(self, *, collection, word, attribute=None, func=None, operation=None):
1213
1216
inside the collection
1214
1217
:param str operation: the logical operation to apply to the
1215
1218
attribute inside the collection
1219
+ :param bool negate: negate the funcion or operation inside the iterable
1216
1220
:rtype: Query
1217
1221
"""
1218
1222
1219
1223
return self .iterable ('all' , collection = collection , word = word ,
1220
- attribute = attribute , func = func , operation = operation )
1224
+ attribute = attribute , func = func , operation = operation ,
1225
+ negate = negate )
1221
1226
1222
1227
@fluent
1223
1228
def order_by (self , attribute = None , * , ascending = True ):
0 commit comments