TND / django-files-widget

Django AJAX upload widget and model field for multiple files or images, featuring drag & drop uploading, upload progress bar, sortable image gallery
Other
88 stars 52 forks source link

Trouble with django-inplaceedit #1

Closed altimore closed 11 years ago

altimore commented 11 years ago

Hello,

I'm using your project (very neat btw) on the same model i use another one called django inplace edit. I'm using these in different views and when inplace edit save it's field he get the form from the model to save it.

By doing so it calls your field which itself calls the function manage_files_on_disk(sender, instance, **kwargs). And this function adds the new_path 'None' to the field even if the tests are not passed which create a strange icon displayed as a file in your widget. I indented the instruction as to do it only if the tests pass.

Regards, Alti.

ps : my text editor automatically delete trailing whitespaces on save, these are the other changes in the file.

maartenth commented 11 years ago

Hello Altimore,

Thank you for fixing this indentation error. I just merged your commit into the master branch.

I have not been very busy updating the Files widget lately, but I hope to add functionality and improve error handling (e.g. better feedback to the user when an upload fails) from the second half of september.

Best regards, Maarten

altimore commented 11 years ago

Sadly this indent correction helps only when there is already a file in the widget. If the field is empty when saving another field, the default value None is still used. I didn't dig in the code a lot, I'll try to spend more time on it soon.

Also for the improvements, it would be quite nice to be able to display the files names under the pictures, because some thumbnails are not generated and some of these are too small to be able to see the differences.

maartenth commented 11 years ago

Hello Altimore,

Sorry for the delay. Did you solve the problem already? If not, I hope to solve it (among other things) in de second half of september.

For the FilesField, I already planned the filename to be displayed under the file icon, and I will add an option to display the filename under images in the ImagesWidget too.

Thank you for your ideas.

Regards, Maarten