Code

Opened 6 years ago

Closed 6 years ago

#7805 closed (fixed)

ImageField doesn't need its own get_internal_type()

Reported by: Gulopine Owned by: nobody
Component: Database layer (models, ORM) Version: master
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation:
Needs tests: Patch needs improvement:
Easy pickings: UI/UX:

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)

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

Download all attachments as: .zip

Change History (2)

Changed 6 years ago by Gulopine

Remove "ImageField" as a separate get_internal_type()

comment:1 Changed 6 years ago by adrian

  • Resolution set to fixed
  • Status changed from new to closed

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

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.