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


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)

7805-r7944.diff (3.7 KB ) - added by Marty Alchin 16 years ago.
Remove "ImageField" as a separate get_internal_type()

Download all attachments as: .zip

Change History (2)

by Marty Alchin, 16 years ago

Attachment: 7805-r7944.diff added

Remove "ImageField" as a separate get_internal_type()

comment:1 by Adrian Holovaty, 16 years ago

Resolution: fixed
Status: newclosed

(In [7947]) Fixed #7805 -- Removed ImageField.get_internal_type() because it doesn't offer anything beyond FileField's implementation. Thanks, Gulopine

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