Changes between Version 3 and Version 4 of Ticket #25756, comment 2
- Timestamp:
- Jan 5, 2016, 6:37:53 AM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #25756, comment 2
v3 v4 1 Hi, I 'm implementing an ArrayField and I can attach a "working" and very dirty implementation.1 Hi, I need to implement an array field for multiple files, and currently this is not supported. 2 2 3 I would like to share here why this is not working after several hours of debug. 3 https://code.djangoproject.com/ticket/25756 4 4 5 So far I found several problems: 5 after hours of debugging I found out several design problems that are preventing to have a clean implementation of this field. 6 6 7 7 1. If you use a FileField this field is using a descriptor to transform strings into File objects (instead of to_python), which is why the array field is always returning strings and not file objects. … … 10 10 11 11 3. the pre save method in file field is the one that is actually saving the file, since ArrayField is not calling the super of that, this cannot work. 12 13 14 array field should support file field out of the box (and this involves also creating a multi file input widget that can work also in the admin). 15 16 another solution is to have a special ArrayFileField, which can also return an ArrayFile object that is iterable (instead of a list). 17 18 I can attach a "working" and dirty version of it.