[Django] #33265: Form.get_context() backward-incompatibility

4 views
Skip to first unread message

Django

unread,
Nov 4, 2021, 11:22:56 AM11/4/21
to django-...@googlegroups.com
#33265: Form.get_context() backward-incompatibility
-------------------------------------------+------------------------
Reporter: Collin Anderson | Owner: nobody
Type: Bug | Status: new
Component: Forms | Version: dev
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------------+------------------------
Hi All,

The new `Form.get_context()` method was added in #31026 on Sept 20th, but
this breaks any form that already has a different `get_context()` method,
for example:

https://github.com/ubernostrum/django-contact-
form/blob/a30a3de7e80936e47ec939e5275ef00f03342688/src/contact_form/forms.py#L94

I'd suggest at least making sure this is documented in the release notes.
But also, is there an upgrade-path for 3rd party libraries like `django-
contact-form` that need to support multiple django versions?

Thanks,
Collin

--
Ticket URL: <https://code.djangoproject.com/ticket/33265>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Nov 4, 2021, 12:19:09 PM11/4/21
to django-...@googlegroups.com
#33265: Form.get_context() backward-incompatibility
---------------------------------+--------------------------------------

Reporter: Collin Anderson | Owner: nobody
Type: Bug | Status: new
Component: Forms | Version: dev
Severity: Normal | Resolution:

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+--------------------------------------

Comment (by Mariusz Felisiak):

New features introduce new methods, some of then may collide with existing
3rd-party packages. `Form.get_context()` is
[https://docs.djangoproject.com/en/4.0/ref/forms/api/#get-context
documented] and mentioned in release notes. I'm not sure what else we
could do 🤔 Do you have any suggestion?

--
Ticket URL: <https://code.djangoproject.com/ticket/33265#comment:1>

Django

unread,
Nov 4, 2021, 2:22:39 PM11/4/21
to django-...@googlegroups.com
#33265: Form.get_context() backward-incompatibility
---------------------------------+--------------------------------------

Reporter: Collin Anderson | Owner: nobody
Type: Bug | Status: new
Component: Forms | Version: dev
Severity: Normal | Resolution:

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+--------------------------------------

Comment (by Collin Anderson):

Right, yeah, maybe there's not too much Django can do about it, but maybe
it could also get a quick mention under "Backwards incompatible changes in
4.0" or something.

--
Ticket URL: <https://code.djangoproject.com/ticket/33265#comment:2>

Django

unread,
Nov 5, 2021, 3:01:17 AM11/5/21
to django-...@googlegroups.com
#33265: Form.get_context() backward-incompatibility
---------------------------------+--------------------------------------

Reporter: Collin Anderson | Owner: nobody
Type: Bug | Status: closed
Component: Forms | Version: dev
Severity: Normal | Resolution: invalid

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+--------------------------------------
Changes (by Mariusz Felisiak):

* status: new => closed
* resolution: => invalid


Comment:

Replying to [comment:2 Collin Anderson]:


> Right, yeah, maybe there's not too much Django can do about it, but
maybe it could also get a quick mention under "Backwards incompatible

changes in 4.1" or something.

I don't have an advice that will work in all cases. Probably the best way
is to [https://github.com/ubernostrum/django-contact-form/pull/61 rename
an existing method] but calling `super().get_context()` can also be an
option, all depends :| I'm going to close it for now due to the lack of
good advice.

--
Ticket URL: <https://code.djangoproject.com/ticket/33265#comment:3>

Reply all
Reply to author
Forward
0 new messages