| 1225 | | executing a separate SQL statement for each row in the table. |
|---|
| 1226 | | |
|---|
| 1227 | | * If the field is a ``BooleanField``, Django will display a pretty "on" or |
|---|
| 1228 | | "off" icon instead of ``True`` or ``False``. |
|---|
| | 1225 | executing a separate SQL statement for each row in the table. If you |
|---|
| | 1226 | want to do this nonetheless, give your model a custom method, and add |
|---|
| | 1227 | that method's name to ``list_display``. (See below for more on custom |
|---|
| | 1228 | methods in ``list_display``.) |
|---|
| | 1229 | |
|---|
| | 1230 | * If the field is a ``BooleanField`` or ``NullBooleanField``, Django will |
|---|
| | 1231 | display a pretty "on" or "off" icon instead of ``True`` or ``False``. |
|---|
| | 1267 | |
|---|
| | 1268 | * The ``__str__()`` method is just as valid in ``list_display`` as any |
|---|
| | 1269 | other model method, so it's perfectly OK to do this:: |
|---|
| | 1270 | |
|---|
| | 1271 | list_display = ('__str__', 'some_other_field') |
|---|
| | 1272 | |
|---|
| | 1273 | * For any element of ``list_display`` that is not a field on the model, the |
|---|
| | 1274 | change list page will not allow ordering by that column. This is because |
|---|
| | 1275 | ordering is done at the database level, and Django has no way of knowing |
|---|
| | 1276 | how to order the result of a custom method at the SQL level. |
|---|