Ticket #10229: list_display.diff
File list_display.diff, 1.2 KB (added by , 15 years ago) |
---|
-
index.txt
364 364 this:: 365 365 366 366 list_display = ('__unicode__', 'some_other_field') 367 368 * If the field being represented derives from a CHOICES tuple, and integers 369 are used as the keys, be sure you're using real integers in the tuple, 370 not strings that look like integers. Otherwise, ``list_display`` will show 371 (None) for this field rather than the value you think should be displayed. 372 For example, this works as expected:: 373 374 YEARS = ( 375 (0,'Non-Vintage'), 376 (9999,'Multi-Vintage'), 377 (1880,'1880'), 378 (1881,'1881'), 379 ) 380 381 While this does not:: 367 382 383 YEARS = ( 384 ('0','Non-Vintage'), 385 ('9999','Multi-Vintage'), 386 ('1880','1880'), 387 ('1881','1881'), 388 ) 389 368 390 * Usually, elements of ``list_display`` that aren't actual database fields 369 391 can't be used in sorting (because Django does all the sorting at the 370 392 database level).