I didn’t get what you meant by parent class (SingleTableView). Kindly explain. For, I am just following tutorials found in google and using it for our need. - Thank you!
Your view, ListTableView inherits from a class named SingleTableView.
There is no SingleTableView class in Django. That means that either you have it defined somewhere in your code, or it comes from a third-party package. Either way, I can’t diagnose problems that may exist in it without seeing it.
If it’s a class in your project, we need to see it here. If it comes from a third-party package, please let us know which one.
Likewise, you have the custom template tag, render_table. It’s also not a standard Django tag. We would need to see the source for it as well.
But I m stuck for concatenation of all those columns. After searching the google found a way for django-tables2 and modified my tables.py as below, but still not working for concatenation. Could you please help?? @KenWhitesell
class ListTable(tables.Table):
addr1 = tables.Column(verbose_name="Address")
class Meta:
model = List
fields = ("Donid", "Name", "addr1", "City", "State", "PAN", "Aadhar", "Mobile", "Email", "Remark")
template_name = "django_tables2/bootstrap4.html"
def render_addr1(self, record, value):
return mark_safe(f"{value}, {record.City}")
I think the problem here may be that you have the render_addr1 method in the class Meta instead of at the class ListTable level. Try un-indenting that function.