MCPcopy Index your code
hub / github.com/MongoEngine/mongoengine / exclude

Method exclude

mongoengine/base/datastructures.py:231–247  ·  view source on GitHub ↗

Filters the list by excluding embedded documents with the given keyword arguments. :param kwargs: The keyword arguments corresponding to the fields to exclude on. *Multiple arguments are treated as if they are ANDed together.* :return: A new ``Embe

(self, **kwargs)

Source from the content-addressed store, hash-verified

229 return EmbeddedDocumentList(values, self._instance, self._name)
230
231 def exclude(self, **kwargs):
232 """
233 Filters the list by excluding embedded documents with the given
234 keyword arguments.
235
236 :param kwargs: The keyword arguments corresponding to the fields to
237 exclude on. *Multiple arguments are treated as if they are ANDed
238 together.*
239 :return: A new ``EmbeddedDocumentList`` containing the non-matching
240 embedded documents.
241
242 Raises ``AttributeError`` if a given keyword is not a valid field for
243 the embedded document class.
244 """
245 exclude = self.__only_matches(self, kwargs)
246 values = [item for item in self if item not in exclude]
247 return EmbeddedDocumentList(values, self._instance, self._name)
248
249 def count(self):
250 """

Callers

nothing calls this directly

Calls 2

__only_matchesMethod · 0.95

Tested by

no test coverage detected