Closed khatchad closed 3 years ago
Another option would be to use a regex to find and replace each text field. I found this: https://stackoverflow.com/questions/3809401/what-is-a-good-regular-expression-to-match-a-url.
I am stuck trying to figure out how to manipulate or modify the content in the td tag, any suggestions?
Here's a link to help you with the attributes: https://django-tables2.readthedocs.io/en/latest/pages/column-attributes.html You need to modify the contents from the tables.py file, not the HTML file. There are some modifications of the td attributes in this file that I did before. You may need to use some of the code.
@mZneit Do you know any way we can change the rendered value of multiple columns? I know that the render_FOO function modifies the rendered data of a single column, but the issue requires the change to apply to every text field, is there any way for the render function to apply the same modification to multiple columns so that we don't have to repeat ourselves? Or do you have other suggestions? If not, then the best solution I can think of is to define a render_FOO function for every required column.
There's a way to modify multiple columns at the same time. You have to work with the meta data of the table where you choose the columns that you want to modify. I'm not sure if this will work in this case though.
If a URL is found in a text field, please activate its link. This would make it easier to read the data. It should apply to all text fields in each view. Really, this is all of the "comment" fields. For example, in https://fathomless-inlet-57767.herokuapp.com/ponder/categorizations?user=11, I see the following value for "func fix comment" for categorization with ID 17:
Instead, it would look like this:
I found a SO post about this but its quite dated.