Link Column in Django Tables 2 -
i'm trying add link column
table have created using django tables 2.
i'm using following code documentation
class peopletable(tables.table): name = tables.linkcolumn('people_detail', text='static text', args=[a('pk')])
view.py
urlpatterns = patterns('', url('people/(\d+)/', views.people_detail, name='people_detail') )
the problem is, when try load webpage following error: reverse 'people_detail' arguments '(1,)' , keyword arguments '{}' not found. 0 pattern(s) tried: []
can see problem here?
edit: url.py looks following:
urlpatterns = [ url(r'^$', views.indexview, name='index'), url(r'^search/$', views.searchview, name='search'), url(r'^people/(\d+)/$', views.myview,{}, name='people_detail'), url(r'^comment/$', views.licensecomment, name='comment'), url(r'^copylicense/$', views.copylicense, name='copy'), url(r'^download/$', views.download, name='download'), url(r'^addmod/$', views.addmodule, name='addmod'), url(r'^removemod/$', views.removemodule, name='removemod'), url(r'^login/$', views.login.as_view(), name='login'), url(r'^logout/$', views.logout, name='logout'), url(r'^create/$', views.get_name, name='create'), url(r'^newlicense/$', views.newlicense.as_view(), name='newlicense'), url(r'^licensecharts/$', views.chart.as_view(), name='viewchart'), url(r'^advancedsearch/$', views.adsearch.as_view(), name='adsearch'), url(r'^advancedrequest/$', views.advancedrequest, name='advancedrequest'), url(r'^editlicense/$', views.editlicense.as_view(), name='editlic'), url(r'^profile/$', views.profileview.as_view(), name='profile'), url(r'^globallog/$', views.logfile.as_view(), name='logfile'), ]
also if remove text='static files'
create link column, error no longer appears, table contains column called name contains dash
if included urls.py namespace, have include namespace when defining link column. example:
class peopletable(tables.table): name = tables.linkcolumn('myapp:people_detail', text='static text', args=[a('pk')])
Comments
Post a Comment