Opened 4 years ago
Closed 4 years ago
#31812 closed Bug (fixed)
The `model` attribute of image fields doesn't point to concrete model.
Reported by: | Matthias Kestenholz | Owned by: | Matthias Kestenholz |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | dev |
Severity: | Release blocker | Keywords: | |
Cc: | Sultan | 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
In Django 3.1 and before, one could use the model
attribute of image fields to find the concrete model the image field belongs to.
This isn't possible in 3.2 anymore, and I bisected the change to the fix of #31701.
I found this while investigating a CI failure of django-imagefield https://travis-ci.org/github/matthiask/django-imagefield/jobs/710794644
I'm not sure whether this is a bug or whether it is an intentional change. If it is the later, is there an alternative to find the concrete model an image field belongs to? I'm classifying this as a bug because the change made model and field introspection harder than it was before. Also, since behavior changed #31701 may possibly not be classified as a cleanup/optimization anymore...
Change History (6)
comment:1 by , 4 years ago
Cc: | added |
---|---|
Severity: | Normal → Release blocker |
Summary: | Possible unintentional consequence of #31701: The `model` attribute of image fields has changed in 3.2 (master) to reference the abstract model → The `model` attribute of image fields doesn't point to concrete model. |
Triage Stage: | Unreviewed → Accepted |
comment:5 by , 4 years ago
Has patch: | set |
---|---|
Owner: | changed from | to
Status: | new → assigned |
Triage Stage: | Accepted → Ready for checkin |
Thanks for the report! I think we should restore
contribute_to_class()
but withattname
:Regression in a93425a37f4defdb31d4ca96bb3bf6da21f0b5ce.
Reproduced at f65454801bfa13fc043fee0aca8f49af41380683.