Aagam41 / db_file_storage

Custom FILE_STORAGE for django. Saves your model's filefields in your database instead of your file system.
MIT License
58 stars 39 forks source link

ModelAdmin mixins for the FileModel #111

Open jayvdb opened 4 years ago

jayvdb commented 4 years ago

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.

Aagam41 commented 10 months ago

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!

jayvdb commented 10 months ago

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