bradleyayers/django-tables2 — pull request #48 by thibault (2012-01-06 13:59:31+00:00)
Title: Separate accessor for sort field (#20)

I forked the @alvarovmz repository to use his patch for this issue, but I found it buggy, hence I hacked it to make it work.

Heres a working exemple :

```python
import django_tables2 as tables

# Display the client column as , but sort it on last name.
class InvoiceTable(tables.Table)
amount = tables.Column()
client = tables.Column()

def render_client(self, value):
return '%s %s' % (value.first_name, value.last_name)

def order_by_client(self, order):
return '%sclient__last_name' % ('-' if order else '')
```