Hi,
I have a model looking like this.
class ProjectMembership(models.Model):
member = models.ForeignKey(User, related_name='project_membership_member_set')
Edit: In a template I want now to access the last_name of the User model. I thought it should work like the following line, but it does not.
{{ project_membership.member.last_name }}
No error is provided. Just the value is missing. I just want to print out the first and last name of the User object referenced in the variable member. Interestingly
{{ project_membership.member }}
does work. This prints out the “human-readable” representation of the User object.