1👍
As you have already mentioned in your original question, someone has already created a branch with the implementation included: branch with extra join. This is a common occurrence when working with open source code that is not a perfect fit for you.
If you did not want to create a new branch yourself, then you can use this person’s code and hope they keep it updated with the official production code base as it changes over time. The alternative is to create your own branch and keep it up-to-date yourself.
The ticket is closed and designated as a “wontfix”, so it is relatively safe to assume that you will not see it in the official Django code any time soon. However, since it is not officially supported, there is no guarantee that the code that you have modified will remain stable with future official versions of Django.
If the patch does not come with unit tests, then you can write a few yourself to ensure it works properly in the future (you should probably do this just to make sure there are no bugs in its current state as well). You can then maintain the tests on your end or send them to the original author of the patch who then has the option to merge them.
Edit: Answer edited in response to OP’s comment.