My app displays a table with many columns. I use Django tables 2 app to render the table. I am trying to make items in one column hyperlinked so that users can click. The url pattern is simple: /contact/pk/
, for e.g. /contact/2/
. This is what I have in my models:
#models.py
class Contact(models.Model):
name = models.CharField(max_length=200)
. . .
class ContactTable(tables.Table):
name = tables.LinkColumn('contact_detail', args=[A('pk')])
class Meta:
model = Contact
attrs = {"class": "paleblue"}
#urls.py
url(r'^contact/(?P<item_id>\d+)/$', 'app.views.contact_view', name='contact_detail'),
However, the items do not get hyperlinked.