1👍
You can .filter(…)
[Django-doc] with:
User.objects.filter(other_user_entries__your_user=myuser)
This will return the User
s for which there is an Entry_B
object where your_user
is the given myuser
object.
Note: It is normally better to make use of the
settings.AUTH_USER_MODEL
[Django-doc] to refer to the user model, than to use theUser
model [Django-doc] directly. For more information you can see the referencing theUser
model section of the documentation.
Source:stackexchange.com