Opened 3 years ago

Last modified 3 years ago

#17224 new Cleanup/optimization

determine and document the use of default option in context of FileField

Reported by: ptone Owned by: nobody
Component: File uploads/storage Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


Currently the 'default' option in the definition of a "FileField" just gets passed on to Field where it is just stored in the database as a raw string.

There are several other potentially viable things FileField could do, including checking to see if it is a valid path to a file, and then copy that to "upload_to" and make that the field's contents.

Either way, whatever is the "proper" action for default, even if it remains unchanged, it should be documented in the FileField docs.

Change History (1)

comment:1 Changed 3 years ago by aaugustin

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted
  • Type changed from Uncategorized to Cleanup/optimization

Duplicating the file pointed by the value of "default" would be the most logical behavior, but it's going to be a bad idea in most cases: since files are never deleted, if would cause lots of useless duplication.

Therefore, it may be preferable to ensure that FileField and ImageField ignore this argument, and document that behavior.

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