MCPcopy Index your code
hub / github.com/django-haystack/django-haystack / negate

Method negate

haystack/backends/__init__.py:342–355  ·  view source on GitHub ↗

Negate the sense of the root connector. This reorganises the children so that the current node has a single child: a negated node containing all the previous children. This slightly odd construction makes adding new children behave more intuitively. Interpre

(self)

Source from the content-addressed store, hash-verified

340 self.children = [obj, node]
341
342 def negate(self):
343 """
344 Negate the sense of the root connector. This reorganises the children
345 so that the current node has a single child: a negated node containing
346 all the previous children. This slightly odd construction makes adding
347 new children behave more intuitively.
348
349 Interpreting the meaning of this negate is up to client code. This
350 method is useful for implementing "not" arrangements.
351 """
352 self.children = [
353 self._new_instance(self.children, self.connector, not self.negated)
354 ]
355 self.connector = self.default
356
357 def start_subtree(self, conn_type):
358 """

Callers 1

add_filterMethod · 0.80

Calls 1

_new_instanceMethod · 0.95

Tested by

no test coverage detected