3👍
✅
You can query for empty strings:
# instances with empty FileField
ApplicationInstitution.objects.filter(transcript_file='')
# and with a file already uploaded
ApplicationInstitution.objects.exclude(transcript_file='')
-1👍
transcript_file = FileField(upload_to=..., null=True)
and try this for ApplicationInstitution
without file:
ApplicationInstitution.objects.filter(transcript_file__isnull=True)
for ApplicationInstitution
with file:
ApplicationInstitution.objects.exclude(transcript_file__isnull=True)
- [Answered ]-Tag detail page with Django-taggit
- [Answered ]-Pip install error: ModuleNotFoundError No module named 'setuptools'
- [Answered ]-Rewrite form with django forms
- [Answered ]-Django MEDIA_ROOT, MEDIA_URL etc
- [Answered ]-Employing caching for the first page of a paginated view in Django
Source:stackexchange.com