Can anyone suggest a way to customize model field display?

For example if I have a model called Course with fields n_girls and
n_students,

if for a particular record n_girls = 4 and n_students = 10, I want to
display for n_girls: "40% (4)" instead of just "4".

Obviously I can do this in the template but there are multiple fields
I want to customize and the lack of switch/elsif statement in the
templates would make for a deeply nested structure so I'd rather do it
upstream in the model.

Thanks in advance.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to