def make_query(self, *args, **kwargs):
        """ Returns a Q object from the submitted form """
        query = Q()  # initial is an empty query
        query_dict = self._build_query_dict(self.cleaned_data)
        if 'negate' in self.cleaned_data and self.cleaned_data['negate']:
            query = query & ~Q(**query_dict)
        else:
            query = query & Q(**query_dict)
        return query
def make_query ( self , * args , ** kwargs ) : query = Q ( ) query_dict = self . _build_query_dict ( self . cleaned_data ) if 'negate' in self . cleaned_data and self . cleaned_data [ 'negate' ] : query = query & ~ Q ( ** query_dict ) else : query = query & Q ( ** query_dict ) return query
Returns a Q object from the submitted form