I cannot find a replacement for the LinkColumn in the new versions of django-tables2. Author states that LinkColumn is deprecated and shouldn't be used. But the new linkify solution is poorly documented and doesn't have all the features of the old version. For example, I have this column:
edit = tables.LinkColumn(
'wagtailadmin_pages:edit', args=[A('page.pk')],
text='Edit'
)
It displays a link to the wagtail admin edit page called Edit. There's simply no way to achieve the same using linkify because linkify only works if you have valid accessor on the column. But accessor cannot return same static text for all rows (unless I modify the model to add a dummy property - but this particular model is in the 3rd party package and it would feel like a duct tape solution anyway).
In all other cases, column will not display a link. I've studied the source code and it seems that such case is simply not supported by the django-tables2 > 2.0.0.
Is there any clean and understandable way to construct a link column with a static link text using linkify?
get_absolute_urlon the model and just passlinkify=True, perhaps, but that depends on the model. Alternatively, you could define a vanillaedit = tables.Column(...)and create arender_editin yourtables.Tablesubclass - Mark R.get_absolute_urlor any other property of the model because it's fromdjango-wagtailpackage. Thanks for suggesting overridingrender_editmethod - I was so focused on trying to make the peskylinkifywork that I totally forgot about trying other approaches. - Eugene Morozov