Opened 12 years ago
Last modified 8 years ago
#545 new enhancement
User().unicode() should be friendlier for templates
Reported by: | spaetz | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | |
Component: | programming | Keywords: | |
Cc: | Parent Tickets: |
Description
Trying to simply put User objects in templates (or convert them to unicode, I get <User #2 verified user "foo">. This is horrible to use in templates where you always need to specify .username or whatnot.
It would be friendlier towards template writer to chose a default represenation that can easily be used in templates, so I can simply embed {{user}} and get an ok default representation of that user in the template.
Hi Spaetz,
The web interface currently uses
User.username
heavily to indicate the author. I actually think that usernames are a bit impersonal though, at least outside the tech community. How about ifUser.__unicode__()
returnedUser.name
if not empty, otherwiseUser.username
?Cheers,
Ben