Hello Mentors and contributors, I’m a web site developer , when I use Django . I custom a class < SomeQuery > base on < Query >, and modify it’s attribute ‘compiler' to Another one <OtherSQLCompler> which custom by myself,. But when I use < SomeQuery > in a < Queryset > object, and call the method filter() with a params ~Q() ,it will call the method ‘split_exclude’ in < Query >,
In the line 1772 in the file <django/db/models/sql/query.py>
# Generate the inner query.
query = Query(self.model)
The code instance a object by the base class < Query >, but I want it instance a object base on < SomeQuery >
So why we don’t make the code like this query = self.__class__(self.model)
I think that is the correct way .