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:


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.

Change History (1)

comment:1 by Ben Sturmfels, 8 years ago

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 if User.__unicode__() returned if not empty, otherwise User.username?


Note: See TracTickets for help on using tickets.