0👍
✅
It appears that it works without the plural.
Event.objects.filter(
participant__user_profile=UserProfile.objects.get(user=get_current_user()))
1👍
First, you have a ForeignKey to auth.User
named user_profile
. That’s quite confusing.
Second, if you want all events NOT related to current user, you want:
Event.objects.exclude(participant__user_profile=request.user)
- [Answer]-How to change unicode to string in django template
- [Answer]-Multi-threading a process within a view function
Source:stackexchange.com