Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Render the TemplateColumn content when exporting #470

Closed
gbataille opened this issue Aug 9, 2017 · 1 comment · Fixed by Karaage-Cluster/karaage#336, mozilla/addons-server#6428, rlmv/doc-trips#90 or drummonds/bene#50
Labels

Comments

@gbataille
Copy link

Or provide a best practice :)

So here is my use case.
In some columns, I don't display the model/DB value straight but rather some HTML, like to make a project name a link to a project.
With the export feature introduced in 1.8.0, the TemplateColumn template is rendered to HTML BUT the HTML is not interpreted.

If I compare that to django_tables_report, they do evaluate the HTML and get rid of the span, a or whatever I put in there.

WDYT?

Alternatively should we have different column definition (one way or another) for export vs HTML rendering?

Thanks

@jieter
Copy link
Owner

jieter commented Aug 15, 2017

Alternatively should we have different column definition (one way or another) for export vs HTML rendering?

We already have something like this, it's called value... Every column has a render() and a value() method. In the default Column, value() just calls render(), as documented here

A possible solution to the TemplateColumn case might be to do something like django_tables_reports did and strip the tags.
I agree it can be clarified in the docs, PR's for that are really welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment