| | 828 | Note that *methods* are also valid arguments to the regroup tag. For |
| | 829 | example, if the "gender" field on the model in this example is a CHOICES |
| | 830 | field rather than a foreign key, ``{{ gender.grouper }}`` will naturally |
| | 831 | have a :ref:`get_FOO_display() <extra-instance-methods>` method |
| | 832 | available as an attribute, so you can group on the display string |
| | 833 | rather than the CHOICES key:: |
| | 834 | |
| | 835 | {% regroup people by get_gender_display as gender_list %} |
| | 836 | |
| | 837 | ``{{ gender.grouper }}`` will now display the value fields from the |
| | 838 | CHOICES set rather than the keys. |
| | 839 | |