'how should django query be in my function?
I have a model with file field i am trying to download the data after querying from database how should my query be.
models.py:
class Mymodel(Basemodel):
file_processed = models.FileField(
upload_to='myfile/ss',
validators=[FileExtensionValidator([''])],
blank=True,
null=True,
editable=False,
views.py :
@api_view(('GET',))
def download_view(request):
d = ''' Mymodel.objects.?'''
response = HttpResponse(
d.file,
content_type='',
)
return response
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
