#35772: Document models.Field.contribute_to_class -------------------------------------+------------------------------------- Reporter: Clifford Gama | Owner: Clifford Type: | Gama Cleanup/optimization | Status: closed Component: Database layer | Version: dev (models, ORM) | Severity: Normal | Resolution: wontfix Keywords: contribute_to_class | Triage Stage: | Unreviewed Has patch: 0 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 -------------------------------------+------------------------------------- Changes (by Natalia Bidart):
* cc: James Bennett (added) * resolution: => wontfix * status: assigned => closed Comment: Hello Clifford, thank you for taking the time to create this ticket. It took me a while to gather information to have an opinion on your proposal. Initially it seemed like a good idea and I couldn't find duplicated ticket reports. Then, I searched some more and found a decent list of resources describing/talking about `contribute_to_class` (in chronological order, and there are more): * [https://code.djangoproject.com/wiki/DevModelCreation#InstallingTheAttributes Django's Wiki 2006] * [https://lazypython.blogspot.com/2008/11/django-models-digging-little- deeper.html Alex Gaynor's post 2008] * [https://www.b-list.org/weblog/2019/mar/04/class/ James Bennet's post 2019] * [https://jacobian.org/til/django-model-fields-with-attributes/ Jacob KM's TIL 2023] The above certainly provides great and detailed documentation about `contribute_to_class`, and I was thinking we could borrow from those to add to the official docs, but then I read James' post where they say: > And now it is time for the second warning in this post: `contribute_to_class()` is an undocumented, private, internal API. Django does not provide backwards-compatibility guarantees for it, and if you make use of it you accept the risk that it might change or break at any time. Given that, I don't think we should accept this ticket without a previous agreement with the community. Therefore, I'll close this ticket accordingly, and the recommended path forward would be to first propose and discuss the idea with the community and gain consensus (perhaps tagging James may be a good idea). To do that, please consider starting a new conversation on the [https://forum.djangoproject.com/c/internals/5 Django Forum], where you'll reach a broader audience and receive additional feedback. -- Ticket URL: <https://code.djangoproject.com/ticket/35772#comment:1> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/010701920542e92b-821d3cf6-f737-4bfb-9bf3-0bf988ec7fb4-000000%40eu-central-1.amazonses.com.