Opened 16 years ago
Closed 16 years ago
#7805 closed (fixed)
ImageField doesn't need its own get_internal_type()
Reported by: | Marty Alchin | Owned by: | nobody |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | dev |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Unreviewed | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
After [7133] went in, it was no longer assumed that most fields in Django would have get_internal_type()
return the name of the class; instead, it's expected to return something that really defines how it should be stored internally. ImageField
is a specialized FileField
, but that specialization has no bearing on how it's stored int he database or anywhere else, so having its get_internal_type()
return a separate value is essentially useless. Doing so also requires all backends to include a separate entry for ImageField
, which essentially has to be a duplicate of FileField
in order to meet expectations, especially if anyone should ever switch from one field type to another.
It makes more sense to simply do away with the internal type of ImageField
altogether and have it simply inherit the FileField
type. There doesn't seem to be any value in making the distinction.
Attachments (1)
Change History (2)
by , 16 years ago
Attachment: | 7805-r7944.diff added |
---|
comment:1 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Remove
"ImageField"
as a separateget_internal_type()