Opened 5 years ago

Closed 5 years ago

#30777 closed Bug (invalid)

File isn't treated correctly, when in user-defined field.

Reported by: Simonas0 Owned by: nobody
Component: File uploads/storage Version: dev
Severity: Normal Keywords: custom field, composite field, user-defined field, file
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

When models.FileField is in models.Model, everything works as expected.
When models.FileField is in models.Field which is in models.Model, when saving, ProgrammingError can't adapt type 'TemporaryUploadedFile' is raised.
That happens, because FileField.save_form_data() makes FileField to hold FieldFile, but models.Field makes its FileField to hold TemporaryUploadedFile.
I've prepared repo with minimal setup to reproduce bug: https://github.com/Simonas0/django_playground

Change History (1)

comment:1 by Mariusz Felisiak, 5 years ago

Resolution: invalid
Status: newclosed
Summary: File isn't treated correctly, when in user-defined fieldFile isn't treated correctly, when in user-defined field.

Trac is not a good place to ask for help. You described an issue with your custom field implementation rather then an issue in Django. Please check documentation and use one of support channels.

Closing per TicketClosingReasons/UseSupportChannels.

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