Conversation
typesystem/fields.py
Outdated
| @@ -1,4 +1,6 @@ | |||
| import decimal | |||
| import imghdr | |||
There was a problem hiding this comment.
Deprecated since 3.11.
https://peps.python.org/pep-0594/#imghdr
There was a problem hiding this comment.
typesystem support version <= 3.10
There was a problem hiding this comment.
3.11 releases just in one week. The typesystem will support it without any doubt.
There was a problem hiding this comment.
Additional dependency lib is not cost-effective. Or do not check the image type.
such as : filetype OR puremagic in pypi
There was a problem hiding this comment.
This can be an optional dependency for those, who wants to use File fields.
There was a problem hiding this comment.
Maybe Image is unnecessary. Just define the File, right?
There was a problem hiding this comment.
It would be nice if File() can validate the file type. So we can specify that we want image, audio, video, etc.
Something like
File(accept=['image/jpeg', 'image/png'])This should answer your question. But IMO, a dedicated Image() field is a nice utility.
|
Please update |
Filefield #115Imagefield #116 file field@aminalaee , docs build failed.