Skip to content

Feature request: Make TemplateColumn more dynamic #928

Open
@rixx

Description

@rixx

I'm migrating a larger project towards django-tables2, and I'd like to reuse some snippets both for tables and for other locations. TemplateColumn fills that niche very nicely, but it's hard-coded to use record as context object name, which doesn't play well with existing templates.

There are several ways this could be solved with fairly minimal impact:

  • allow to set context_object_name like in other Django places, defaulting to record
  • allow extra_context to be a callable, passing the arguments received by render()
  • move context collection to a get_context_data method allowing for easy subclassing

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions