-
Notifications
You must be signed in to change notification settings - Fork 429
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Feature request: Make TemplateColumn more dynamic #928
Comments
jieter
added a commit
that referenced
this issue
Oct 17, 2023
…a_context` optionally callable fixes: #928
Interesting suggestions! I did a quick POC for the first two (#931), but they'll have to be documented still. Can you show an example of how you imagine the third suggestion should work? |
jieter
added a commit
that referenced
this issue
Oct 17, 2023
…a_context` optionally callable fixes: #928
Oh cool! I think if 2) is implemented, 3) won't be needed in addition – subclassing is more troublesome anyway than just passing a callable parameter. |
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
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 userecord
as context object name, which doesn't play well with existing templates.There are several ways this could be solved with fairly minimal impact:
context_object_name
like in other Django places, defaulting torecord
extra_context
to be a callable, passing the arguments received byrender()
get_context_data
method allowing for easy subclassingThe text was updated successfully, but these errors were encountered: