Friday, October 6, 2017

django_tables2: Unable to manually iterate through column values in template

Hi all

I came to django_tables2 via django_tables.

There are a few occasions when I want to manually iterate through the columns of each row of a table in my template.  I've always done this using:

{% for row in table.rows %}{{ row.det_id }}  {% endfor %}

It's worked OK in my code for years - on Django 1.9 and django_tables2 1.1.1

However, I recently upgraded to django_tables2 1.10, and this no longer works.  (I just get empty fields - not even hyphens.)

How do I do the iteration now?  If I am required to do this completely differently, then the migration info from django_tables to django_tables2 is now misleading.

Cheers,

Ken


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/5267310d-a954-478c-b350-5dc5d1dfd53b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment