diff --git a/django_tables2/columns/templatecolumn.py b/django_tables2/columns/templatecolumn.py index c3036207..f5fab1e7 100644 --- a/django_tables2/columns/templatecolumn.py +++ b/django_tables2/columns/templatecolumn.py @@ -15,6 +15,7 @@ class TemplateColumn(Column): Arguments: template_code (str): template code to render template_name (str): name of the template to render + context_object_name (str): name of the context variable to pas the record in, defaults to "record". extra_context (dict): optional extra template context A `~django.template.Template` object is created from the @@ -25,6 +26,7 @@ class TemplateColumn(Column): - *default* -- appropriate default value to use as fallback. - *row_counter* -- The number of the row this cell is being rendered in. - any context variables passed using the `extra_context` argument to `TemplateColumn`. + If ``extra_context`` is a callable, it will be called with optional record, table, value, bound_column arguments. Example: @@ -91,6 +93,3 @@ def value(self, **kwargs): """ html = super().value(**kwargs) return strip_tags(html).strip() if isinstance(html, str) else html - - def get_context_data(self, **kwargs): - return