From 475dd3df5f35a3018d62a736407176ec11cda754 Mon Sep 17 00:00:00 2001 From: Jan Pieter Waagmeester Date: Tue, 17 Oct 2023 14:10:00 +0200 Subject: [PATCH] Add basic docs, remove stub get_context_data --- django_tables2/columns/templatecolumn.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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