Frage

I would like to use a patched version of Django to solve a problem described here:

https://code.djangoproject.com/ticket/7231

As you can see at the bottom, a patch exists, and I would like to use it.

https://github.com/thirstydigital/django/commit/c7b99ad2d4b43d99b2c0f8ceba92b3d9eb07ed73

However I am concerned about what will happen if I upgrade Django to a newer release.

Django code is usually (reasonably) backwards compatible, but I am worried that using this may affect that. Will I have to remember to apply the patch after upgrading, and do I know that it will exist for a newer version?

War es hilfreich?

Lösung

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.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top