@@ -338,6 +338,26 @@ def header(self):
338
338
"""
339
339
return self .verbose_name
340
340
341
+ @property
342
+ def header_value (self ):
343
+ """
344
+ The value used for the column heading in exports.
345
+
346
+ By default this returns `~.Column.header`.
347
+
348
+ :returns: `unicode` or `None`
349
+
350
+ .. note::
351
+
352
+ This property typically is not accessed directly when a table is
353
+ rendered. Instead, `.BoundColumn.header_value` is accessed which
354
+ in turn accesses this property. This allows the header to fallback
355
+ to the column name (it is only available on a `.BoundColumn` object
356
+ hence accessing that first) when this property doesn't return something
357
+ useful.
358
+ """
359
+ return self .header
360
+
341
361
def footer (self , bound_column , table ):
342
362
"""Return the content of the footer, if specified."""
343
363
footer_kwargs = {"column" : self , "bound_column" : bound_column , "table" : table }
@@ -556,6 +576,14 @@ def header(self):
556
576
# fall back to automatic best guess
557
577
return self .verbose_name
558
578
579
+ @property
580
+ def header_value (self ):
581
+ """The contents of the header for this column in an export."""
582
+ column_header_value = self .column .header_value
583
+ if column_header_value :
584
+ return column_header_value
585
+ return self .header
586
+
559
587
@property
560
588
def footer (self ):
561
589
"""The contents of the footer cell for this column."""
0 commit comments