Opened 3 years ago

Closed 3 years ago

#33265 closed Bug (invalid)

Form.get_context() backward-incompatibility

Reported by: Collin Anderson Owned by: nobody
Component: Forms Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

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

Change History (3)

comment:1 by Mariusz Felisiak, 3 years ago

New features introduce new methods, some of then may collide with existing 3rd-party packages. Form.get_context() is documented and mentioned in release notes. I'm not sure what else we could do 🤔 Do you have any suggestion?

comment:2 by Collin Anderson, 3 years ago

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.

Version 0, edited 3 years ago by Collin Anderson (next)

in reply to:  2 comment:3 by Mariusz Felisiak, 3 years ago

Resolution: invalid
Status: newclosed

Replying to 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 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.

Note: See TracTickets for help on using tickets.
Back to Top