I'd like to add multiple 'items' to the same cell using tables.LinkColumn
.
Something like this:
column_name = tables.LinkColumn('some_url_edit', args=[A('pk')], attrs={'class':'tbl_icon edit'})
column_name += tables.LinkColumn('some_url_del', args=[A('pk')], attrs={'class':'tbl_icon delete'})
column_name += ...
Is this even possible? or should I create my own table view, without django-tables
.
Thanks!
Example with render foo didn't work for me with column defined as
tables.Column()
. Now i use TemplateColumn with render_FOO.You have two options here, either use a
TemplateColumn
, or write arender_FOO
method.Here is an example using the
TemplateColumn
(as you can see the record is added to the context that is used to render the template, thus allowing you to access thepk
viarecord.pk
:Example using the
render_FOO
:As you can see the
TemplateColumn
approach is probably a little cleaner in your case.