I'd like the simplest way to show "You" instead of a username if that username matches that of the current user.
ideally a filter like this (where object.owner is a ForeignKey field pointing at auth.User)
{{ object.owner|username_or_you }}
or a way to intercept this higher up the chain - so anywhere i output user.username it'll output "You" or the actual username in question.
currently I have this:
{{ object.owner|username_or_you,request.user }}
where the filter looks like this:
def username_or_you(user, request_user):
if user == request_user:
return "You"
else:
return user