I'm trying to print the request in my view but nothing happens when I click on the 'Editar' button (TemplateColumn), this is what I have in my code:
tables.py
import django_tables2 as tables
from django_tables2 import TemplateColumn
from .models import Vencimientos, LogAsistencia
class VencimientosTable(tables.Table):
asistencia = TemplateColumn(
'<a class="btn btn btn-info btn-sm" href="{% url "checkin" record.id %}">Editar</a>')
class Meta:
model = Vencimientos
template_name = "django_tables2/bootstrap5.html"
fields = ("cliente","vencimiento","activo" )
attrs = {"class": "table table-hover table-sm"}
urls.py
urlpatterns = [
....
path('asistencia/<int:pk>/', CheckIn.as_view(), name='checkin')
]
views.py
class CheckIn(View):
def get(self, request):
print(request)
return redirect ('asistencia')
when I click on the "Editar" button in the table the idea is to get the record.id so I can add some extra code, but the button doesn´t do anything
UPDATE
I inspect the button and I see the link correct:
The button doesn´t do anything still

Use a custom render_ method to achieve what you're trying to do.