Questions tagged [django-tables2]

django-tables2 simplifies the task of turning sets of data into HTML tables.

Native support for pagination and sorting. It does for HTML tables what django.forms does for HTML forms.

  • Any iterable can be a data-source, but special support for Django querysets is included.
  • The builtin UI does not rely on JavaScript.
  • Support for automatic table generation based on a Django model.
  • Supports custom column functionality via subclassing.
  • Pagination.
  • Column based table sorting.
  • Template tag to enable trivial rendering to HTML.
  • Generic view mixin.

Related links:

628 questions
3
votes
2 answers

django-tables2 edit yesno parameter for all BooleanColumn

I have a table.py where I would like to change the icons for True and False values of each BooleanColumn. I know that it can be modified by the yesno paramter of BooleanColumn, but I do not know how to override the default for all BooleanColumns.…
3
votes
1 answer

How to edit data with django-tables2 in a frontend?

I have a Django and i want to create CRM system, allowing users to view, add, delete and edit data in a front-end. I found nice module, named django-tables2, which allows displaying nice tables of my data: django-tables2 turns data into HTML…
Dmitry Yudin
  • 1,033
  • 1
  • 10
  • 31
3
votes
1 answer

Sorting tables when multiple tables in a view (django-tables2)

Is it possible to sort two (or more) tables independently in a single view? I have two tables in a view: one through CBV SingleTableView (Table A) and one passed in through the context (Table B). When trying to sort Table B, the correct url is…
Nathan Crabbe
  • 155
  • 1
  • 14
3
votes
1 answer

set empty text behavior for django-tables2

Some columns in my django table happened to be empty and as a result the text rendered there is 'None'. I would like to see a blank space instead. django tables2 has some documentation on the subject, but I don't understand it completely. Where do I…
Ron Zukerman
  • 61
  • 1
  • 8
3
votes
1 answer

django-tables2 checkbox column name

I've created my table output with django-tables2, but I want a specific name in the table column for the check-boxes. How can I do that ? Here is my class for the table drawing, I've modified the sequence of the columns so that my check-box is the…
Bogdan
  • 349
  • 1
  • 4
  • 15
3
votes
3 answers

Inherit and modify a `Meta` class

So I have a base ItemTable, and then a number of Tables that inherit from it. I don't seem to be able to modify the Meta class. I tried just including the meta class normally and it didn't work, then I found this bug report and implemented it…
thumbtackthief
  • 6,093
  • 10
  • 41
  • 87
3
votes
1 answer

Django Tables adding a LinkColumn / NoReverseMatch Error

I have a model with some fields and I want to add a LinkColumn to a detail page. I have a working version, but I want to move to django-tables2 The problem is that the link column doesnt show any link, just a "-" The model class…
Pablo V.
  • 324
  • 2
  • 16
3
votes
1 answer

Is there a way to use django-inplaceedit to do in-place editing of a column in django-tables2 TemplateColumn?

I tried to make a state_template.html with {% load inplace_edit %} {% block extra_header %} {% inplace_static %} {% endblock %} {% inplace_edit "action.action_state" %} And tables.py has: action_state =…
Hec
  • 824
  • 1
  • 5
  • 24
3
votes
2 answers

how do i create a table from a dict using django-tables2

I have a list of dict that look like this: [set([u'meal', '0:08:35.882945']), set([0, u'personal']), set([0, u'sleep']), set([0, u'transport']), set([0, u'work'])] That I made from : [u'meal',u'personal', u'sleep', u'transport',…
mike
  • 897
  • 2
  • 10
  • 29
3
votes
1 answer

Equivalent of django-tables2 for Pyramid?

Is there a Pyramid equivalent for django-tables2? I find this library really awesome... almost perfect I would say, and I am trying to find an equivalent now that I switched to Pyramid.
DevLounge
  • 8,313
  • 3
  • 31
  • 44
3
votes
0 answers

django_tables2 using Foreign Key to populate tables

I'm trying to create a table on my website and a stackoverflow user suggest me to use django_table2 for it. I try it and in a few minutes I had a nice table, the problem is that I had the table using the classmodel.objects.all(), but I have foreign…
amb1s1
  • 1,995
  • 5
  • 22
  • 26
3
votes
1 answer

Django-tables2 - how to use a custom filter in a TemplateColumn

I have a TemplateColumn in a django-tables2 table and I want to use a custom template filter (named int_to_time) to transform the data. When I use a built in filter it works fine. What I have done until now is that I've copied the…
Serafeim
  • 14,962
  • 14
  • 91
  • 133
2
votes
2 answers

Conditional column display, django-tables2

I have developed a table, using django-tables2 which shows records of a model. The last column of this table, is an "edit button" which leads user to the "edit page" of its row record. What I want is that the user can see the edit column only if she…
Hamidreza
  • 1,465
  • 12
  • 31
2
votes
2 answers

Django-tables2 - how can I get counts out in my table on a custom table field?

I'm trying to get some frequency data out from my queryset in a column in my table in django-tables2. I am trying this via a custom field: class MyTable(tables.Table): custom_field = tables.Column(empty_values=()) def…
trouselife
  • 971
  • 14
  • 36
2
votes
1 answer

Conditional statements in Django_tables2 class definition

I am trying to change formatting of my table rows based on one of my object values. I know how to pass row attributes to my template, but don't know how to use current record when deciding how should my row look like in class definition. See…
Jorhanc
  • 310
  • 2
  • 13