db_file_storage icon indicating copy to clipboard operation
db_file_storage copied to clipboard

ModelAdmin mixins for the FileModel

Open jayvdb opened this issue 4 years ago • 2 comments

I like to have Django admin support for all models in DEBUG mode, as it helps understanding of the data model, making onboarding new devs easier.

The initial mixin could put the entire model into "read only" mode within Django admin - that is still useful.

Full edit support is easy for a text based file store.

The main field where editing is useful would be the mimetype. Sometimes that needs to be made more precise, e.g. using newly defined mimetypes like application/vnd.open-api+yaml for old files which were a normal yaml mimetype.

Widgets for uploading raw binary data is a bit tricky, but is possible. e.g. https://stackoverflow.com/questions/58529099/adding-file-upload-widget-for-binaryfield-to-django-admin

However the admin for the FileModel could simply disable "add" until there is some way to upload the binary file.

jayvdb avatar Aug 25 '20 05:08 jayvdb

Hello,

I've been going through the idea you shared, and I find it quite intriguing!

To move things forward, would you be interested in submitting a pull request with your implementation, or perhaps collaborating on bringing this idea to life?

Let me know if you have any questions or need guidance on the next steps. Looking forward to your active contribution!

Aagam41 avatar Jan 16 '24 15:01 Aagam41

sorry I dont use django much these days, so wont be able to help with this.

jayvdb avatar Jan 16 '24 21:01 jayvdb