get_FOO_display for a grouper

10 views
Skip to first unread message

sorrison

unread,
Nov 8, 2006, 9:27:34 PM11/8/06
to Django users
I have a class with a "site" field that uses choices
I want to display the human readable name for it when being used as a
grouper

i thought something like
site.get_grouper_display or get_site.grouper_display

but that doesn't work

here is the template code

{% regroup object_list|dictsort:"group" by group as sites %}
<ul>
{% for site in sites %}
<li><h3>{{ site.grouper }}</h3></li>
<ul>
{% for buddy in site.list %}
<li><a href="/buddy/{{ buddy.name|lower}}/">{{ buddy.alias
}}</a></li>
{% endfor %}
</ul>
{% endfor %}
</ul>

is there a way to do it?

Thanks,

Sam

Reply all
Reply to author
Forward
0 new messages