New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Easier File and Image model fields usage #507
Conversation
6 similar comments
5 similar comments
@DylannCordel this is awesome! |
8be2023
to
cafdec8
Compare
1 similar comment
I rebased with the "develop" branch ( @yakky : sorry for noise : I did a pull instead of a rebase and I pushed a real mess... Thx to @ollb for his help about git to clean it) I added:
I'd like to add tests for Reversed ForeignKey relations ( |
cafdec8
to
10489f3
Compare
rebased with develop |
10489f3
to
b8a4a48
Compare
@DylannCordel I really like this PR. It looks like we've been making it hard for you to keep up. Sorry about that. Can you rebase one more time and I'll try to get this into a release soon. |
@mkoistinen okay, I'll do this ASAP. |
5e9b9a8
to
5c91403
Compare
* mimetype validator (for File's FK and for ajax uploads) * allow to configure a default folder destination for each filer model field * Add a direct (ajax) upload with a simple "browse" button and allow to disable the default "file lookup" for each filer model fields. * Add a related_field param for ajax upload to retrieve model's field's mimetype validators and reject wrong files at the begening of the upload to avoid "upload then reject" for huge files.
JS are only in external files managed by the form to be compatible with a HTML layout with javascript added at the bottom of the body (as it is recommended)
5c91403
to
c71107c
Compare
Code is rebased. I had to throw in trash some part of my work because of the dropzone addition which duplicates a part of the features of this PR (which will be 1 year old soon). |
@DylannCordel we're preparing a release 1.3 now, any chance you could (yet again, sorry!) rebase? |
+1 for this |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This will now be closed due to inactivity, but feel free to reopen it. |
With this pull request, when a dev define an Image's foeignKey, he can configure :
image/jpeg
) and/or mimetypes (e.g:image/*
)DefaultFolderGetter child
. This method takes the request and must return a folder.Tests for "dynamic" folder destination and mimetype detections have been added.
If you think this pull request is usefull and mergeable, I'll add:
'News.illustration'
).direct_upload
's view will be able to retrieve validators associated to this field and reject files during the ajax upload and not only when the object (the news) is saved.Simple usage exemple: