bradleyayers/django-tables2 — pull request #208 by CptLemming (2014-08-18 13:35:13+00:00)
Title: Add support to CheckBoxColumn to render a checkbox as checked

### Simple version:
Using the `checked` argument, test a column in the data set is a non-falsey value

```python
class CheckTable(tables.Table):
action = tables.CheckBoxColumn(checked='selected')
name = tables.Column()

data = [
{'name': 'Foo', 'selected': True},
{'name': 'Bar', 'selected': False}
]
table = CheckTable(data)
# The first row checkbox will be checked, the second un-checked
```

### Callback support

```python
def is_selected(value, record):
if value == 'action':
return True
return False

class CheckTable(tables.Table):
action = tables.CheckBoxColumn(accessor='id', checked='status')
username = tables.Column()

data = [
{'id': 1, 'username': 'Foo', 'status': 'active'},
{'id': 2, 'username': 'Bar', 'status': 'inactive'}
]
table = CheckTable(data)
# Render first row checked, with the id as the checkbox value
```