1

Am new to django-tables2, and cannot understand why I'm getting this result:

"Invalid block tag: 'querystring' "

...when attempting to use this template:

{% load render_table from django_tables2 %}
{% querystring "sort"="" %} 
{% render_table table %}`

And this line is included in the settings.py file:

TEMPLATE_CONTEXT_PROCESSORS += ('django.core.context_processors.request',)

The table renders fine (in its most very basic state) if the querystring line is omitted from the template. But am working towards getting it to filter in addition to sort (which doesn't seem to be well documented), therefore I think it is necessary in order to provide URL parameters for the filter.

I had understood that the inclusion of that line in the settings was all that was necessary for the querystring tag in the template to work, but apparently not...?

ruddra
  • 50,746
  • 7
  • 78
  • 101
FunkyOne
  • 51
  • 1
  • 5

1 Answers1

2

From what I see, you are loading only render_table from django_tables2! If you wanted to also use the querystring tag you could instead do a {% load django_tables2 %} to load all tags!

As a more general comment, I see that you want to add filtering to the tables. I am not sure why you need that -- please check my answer to this question Django Tables - Column Filtering for an extensive analysis of filtering on django-tables2.

Community
  • 1
  • 1
Serafeim
  • 14,962
  • 14
  • 91
  • 133