78👍
✅
I was having this issue too, and finally found the solution!
no_files = MyModel.objects.filter(foo='')
This works because internally, the FileField
is represented as a local file path in a CharField
, and Django stores non-files as an empty string ''
in the database.
- [Django]-Creating my own context processor in django
- [Django]-Django default_from_email name
- [Django]-Making django server accessible in LAN
Source:stackexchange.com