Django

Code

Ticket #7805 (closed: fixed)

Opened 5 months ago

Last modified 5 months ago

ImageField doesn't need its own get_internal_type()

Reported by: Gulopine Assigned to: nobody
Milestone: Component: Database layer (models, ORM)
Version: SVN Keywords:
Cc: Triage Stage: Unreviewed
Has patch: 1 Needs documentation:
Needs tests: Patch needs improvement:

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

7805-r7944.diff (3.7 kB) - added by Gulopine on 07/17/08 20:41:45.
Remove "ImageField" as a separate get_internal_type()

Change History

07/17/08 20:41:45 changed by Gulopine

  • attachment 7805-r7944.diff added.

Remove "ImageField" as a separate get_internal_type()

07/17/08 23:34:48 changed by adrian

  • status changed from new to closed.
  • resolution set to fixed.

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


Add/Change #7805 (ImageField doesn't need its own get_internal_type())




Change Properties
Action