(self, other, conn)
| 72 | raise ValueError(f"connector must be one of {connector_reprs}, or None.") |
| 73 | |
| 74 | def _combine(self, other, conn): |
| 75 | if getattr(other, "conditional", False) is False: |
| 76 | raise TypeError(other) |
| 77 | if not self: |
| 78 | return other.copy() |
| 79 | if not other and isinstance(other, Q): |
| 80 | return self.copy() |
| 81 | |
| 82 | obj = self.create(connector=conn) |
| 83 | obj.add(self, conn) |
| 84 | obj.add(other, conn) |
| 85 | return obj |
| 86 | |
| 87 | def __or__(self, other): |
| 88 | return self._combine(other, self.OR) |