So this is my query and it displays only file name but I want 'id' also.
filenames=Upload.objects.values('file').distinct().filter(created_by=request.user).all()
this will generate only unique files as dict. But I want 'id' of those files also and if use 'id' inside that 'values' it will not give unique file names. So this is my issue. I'm okay with other methods as well to solve this issue.