Ticket #4858: 4858.patch

File 4858.patch, 725 bytes (added by Collin Grady <cgrady@…>, 17 years ago)
  • django/db/models/query.py

     
    752752    def __or__(self, other):
    753753        return QOr(self, other)
    754754
     755    def __invert__(self):
     756        return QNot(self)
     757
    755758    def get_sql(self, opts):
    756759        return parse_lookup(self.kwargs.items(), opts)
    757760
     
    761764        "Creates a negation of the q object passed in."
    762765        self.q = q
    763766
     767    def __invert__(self):
     768        "Returns the inner, non-negated q object"
     769        return self.q
     770
    764771    def get_sql(self, opts):
    765772        try:
    766773            joins, where, params = self.q.get_sql(opts)
Back to Top