Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#24099 closed Cleanup/optimization (fixed)

Remove ContentType.name

Reported by: Claude Paroz Owned by: nobody
Component: contrib.contenttypes Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Work has been done in #16803 to deprecate the denormalized hardcoded ContentType.name field, but the final deprecation was depending on a schema migration framework. I think it's now time to finish that task and finally remove the field.

Change History (8)

comment:1 Changed 4 years ago by Tim Graham

Triage Stage: UnreviewedAccepted

Do you think this needs a deprecation cycle in some way?

comment:2 Changed 4 years ago by Claude Paroz

See the proposed PR: https://github.com/django/django/pull/3858

Passing the name field when creating a ContentType is still allowed, but the field is simply discarded and a warning is emitted. I think that it's important to allow for example for existing fixtures to still be used. Hopefully this deprecation strategy will be enough, usage will tell.

comment:3 Changed 4 years ago by Tim Graham

Has patch: set
Triage Stage: AcceptedReady for checkin

comment:4 Changed 4 years ago by Claude Paroz

Triage Stage: Ready for checkinAccepted

The migration is not reversible because the name field is not nullable. I don't think this is acceptable. Does someone know about a workaround? Should we add an intermediary migration?

comment:5 Changed 4 years ago by Tim Graham

Patch needs improvement: set

comment:6 Changed 4 years ago by Tim Graham

Patch needs improvement: unset
Triage Stage: AcceptedReady for checkin

comment:7 Changed 4 years ago by Markus Holtermann <info@…>

Resolution: fixed
Status: newclosed

In b4ac23290772e0c11379eb2dfb81c750b7052b66:

Fixed #24099 -- Removed contenttype.name deprecated field

This finsishes the work started on #16803.
Thanks Simon Charette, Tim Graham and Collin Anderson for the
reviews.

comment:8 Changed 4 years ago by Tim Graham <timograham@…>

In 75374d3:

Refs #24099 -- Removed compatibility shim for ContentType.name field.

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