Django

Code

Ticket #4858: 4858.patch

File 4858.patch, 0.7 kB (added by Collin Grady <cgrady@the-magi.us>, 1 year ago)
  • django/db/models/query.py

    old new  
    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)