1👍
✅
You have two foreign keys from CustomUser to Score. The first one, user_from
, does not set a related_name, so it uses the default, which is score_set
:
x = y.score_set.all()
The second does set a related_name, so you use that:
x = y.user_to.all()
Note that this does not make much sense as a related name, since it points to scores, not users; it should probably be something like scores_to_user
.
Source:stackexchange.com