Hi there!

I already created a ticket regarding this matter, but I think this thicket 
requires some discussion prior to crafting a solution.
https://code.djangoproject.com/ticket/28554

The django.db.models.FileField currently allows only to store a single file 
URL.
This behavior seems outdated considering that input[type=file] supports a 
multiple attribute, which is supported by all major Browsers.
See: ​https://www.w3schools.com/tags/att_input_multiple.asp

I would suggest to have a similar attribute on the database field itself, 
as well as on the form field and widget.

The major point for discussion would be how to store the data. The easiest 
would be to coma separate the paths in a single char field. The major 
concern here would be the lack of atomicity. For databases like Postgres I 
would be sensical to use the ArrayField as an underlying structure. Another 
way for serialisation would be the use of JSONs in a char field.

All solutions based on a text or char field have an issue related to the 
compatibility with the current FileField which is limited to 100 
characters. The type would need to be migrated to a text type or the length 
would need to be increased. The latter options bares the question to which 
point.

Another approach would be to defer the storage issue and only provide 
support for multiple files on form level.
This would mean to add a multiple attribute to the form field and widget. 
Users would be able to create forms with multiple files in a single field 
and handle storage according to their preference.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/c08a5bd5-ae4b-49cb-a07a-14c287672a39%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to