[Answer]-How to get files belonging to the current logged in user? Relations

1👍

files = File.objects.filter(userfile__user=request.user)

and template is just:

{% for file in files %}{{ file.src }}{% endfor %}

see lookups that span relationships

Leave a comment