Admin form UI improvements and multi file upload support - #1
Conversation
| python -m pip install --upgrade pip | ||
| pip install -r requirements.txt | ||
|
|
||
| - name: Run tests |
There was a problem hiding this comment.
I tried to get selenium tests to work and didnt seem like worth the effort. If time allows, it might be worth looking into using something like playwright instead considering they have better docs on how to run in a GH action https://playwright.dev/python/docs/ci-intro
There was a problem hiding this comment.
copilot was EXTREMELY helpful in migrating to playwright! wooooo
| if self.chunk_storage_name: | ||
| # If a specific storage backend is configured, use it | ||
| if storages: | ||
| # Django 4.2+ - check if it's a STORAGES key or class path |
There was a problem hiding this comment.
Changes in this file are in the effort of resolving the following error, while maintaining support for older versions of django
RemovedInDjango51Warning: django.core.files.storage.get_storage_class is deprecated in favor of using django.core.files.storage.storages
| @@ -0,0 +1,55 @@ | |||
| # django-resumable-async-upload | |||
| return JsonResponse({'status': 'success', 'message': 'File removed'}) | ||
| except Exception as e: | ||
| logger.error(f"Failed to delete file: {str(e)}") | ||
| return JsonResponse({'error': f"Failed to delete file: {file_path} "}, status=500) |
There was a problem hiding this comment.
Okay to ship without resolving this:
If an there is an error during json.loads() on line 50, then file_path will raise an error here bc it hasn't been defined.
A potential fix is to declare file_path before try statement file_path = None.
There was a problem hiding this comment.
good catch! I made the change per your suggestion.
pollardld
left a comment
There was a problem hiding this comment.
This is quality open source software!
Adds the following features to the package
Admin form UI changes:
Supports Multi-file uploads
FormResumableMultipleFileFieldthat handles sending multiple files in a listsave_modelmethod, doing the following:Config changes
max_filesparam forAsyncFileFieldto allow for configuration of how many files can be uploaded to a file input. Defaults toundefined, which is unlimited.Storages changes
DEFAULT_FILE_STORAGEin favor ofstorageswhile maintaining backwards compatibilityTesting
Screenshots