django-tables2 Questions

8

Solved

I'm trying to add a counter on the first column of a table using django-tables2, but the solution below is only showing all 0 under the # column. How should I add a column that will have a column t...
Vita asked 8/6, 2016 at 6:38

2

Solved

I'm rendering a queryset with django-tables 2 but since the table is rendered at once I can't manage the following: Firstly, I should mention that the number of rows of the table is different with ...
Sayyid asked 30/8, 2012 at 7:34

2

Solved

I have narrowed down to the following , if anyone can help me pointing out how i can convert the following into table view that would be awesome. Following html is extended from the base.html {% b...
Hung asked 5/1, 2020 at 11:6

2

I've tried reading the docs and previous answers to this question without much luck. I've got a bunch of student-course registrations and I'd like to see some of those selected registrations in co...
Chatelain asked 25/12, 2013 at 22:3

5

Solved

I am new to django and web development and based on examples and help on SO, I have pieced together something which takes a model and renders it in a django-table. My template code is basically as ...
Chino asked 13/3, 2017 at 11:40

1

Solved

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 shou...
Runge asked 19/2, 2021 at 13:48

4

Solved

I am trying to create some tables for my application using django-tables2 and running into some difficulties. I am using Python 2.7, and Django 1.7. I am following the tutorial, and I ran into prob...
Asaasabi asked 16/4, 2015 at 18:38

2

Solved

I'd like to add multiple 'items' to the same cell using tables.LinkColumn. Something like this: column_name = tables.LinkColumn('some_url_edit', args=[A('pk')], attrs={'class':'tbl_icon edit'}) c...
Crosscountry asked 8/6, 2011 at 6:52

4

I started using django-tables2 (which I can highly recommend from the first impression) and I m asking myself how to implement column filtering. I do not find the appropriate documentation for it, ...
Paderna asked 28/11, 2012 at 18:14

3

Solved

I'm currently displaying a dataset using django-tables2. The docs make no mention of this in particular, so I'm guessing this'll take probably some table overriding - but, I'm hopeful someone out ...
Estas asked 7/5, 2013 at 0:12

3

Solved

I'm currently using django-tables2 to display a queryset of my model. One of the attributes of this model is a DateTimeField accurate to the millisecond which is being truncated to the minute in my...
Dowse asked 20/1, 2015 at 15:22

4

Solved

I would like to create a table with django-tables2 such that different rows have different properties. By default I get either <tr class="odd"> or <tr class="even"> How can I sp...
Spaceless asked 1/3, 2012 at 23:10

3

I'm need to add an additional filter property (in the background) to a django-filter request. My Model: class Event(models.Model): name=models.CharField(max_length=254) location=models.ForeignK...

1

When using django-tables2, use the paginate parameter to limit the number of rows displayed. For instance, if I have the table my_table, then in views.py I set it to display 10 rows as follows: Re...
Guitarfish asked 12/2, 2018 at 18:8

3

Solved

I use django_tables2 to render my tables. For one table, I only want to see the most recent 5 entries. Therefore, I need to order my queryset before passing it to the table object: qset = myObject...
Hosiery asked 17/11, 2017 at 14:45

2

Solved

In my Django project I need to have tables which columns are dynamic and depend on what is in the database. So I found a solution in here and it works but with a little problem. Here's the class wi...
Almaraz asked 22/5, 2013 at 15:40

2

Solved

I have a django app, which allows the user to upload a csv file, say a csv file of rankings of universities. I'd have to process the data that has been uploaded. For example, grey out any column wh...
Agrology asked 22/5, 2017 at 23:31

2

Solved

In django-tables2 I have a table which I do not want paginated. I have not specified pagination, as shown in the docs: table.paginate(page=request.GET.get('page', 1), per_page=25) The tables sti...
Suricate asked 11/1, 2013 at 14:57

3

Solved

I am trying to add a extra column to one of my tables, that adds url to another page. My Table: class ItemTable(tables.Table): edit = tables.LinkColumn('item_edit', args=[A('pk')]) class Meta: ...
Sandhog asked 8/4, 2014 at 15:26

1

Solved

is it possible to change a color of row based on current object's value? In my case, I have a table created from model Job. The Job has attribute delivery. If job.delivery is for example 'delivere...
Hasten asked 29/5, 2016 at 18:29

1

Solved

I've had a search around for this but haven't had much luck so looking for a bit of help. I'm trying to add some extra columns to a table defined by a model, using function definitions in the model...
Jaxartes asked 7/3, 2016 at 9:27

2

Currently using Haystack 2.1 with Tables2(Dev 0.16) to manage queries using Elastisearch. When I attempt a search I get the following error messsage: Expected table or queryset, not 'str'. Details ...
Manes asked 14/3, 2014 at 17:34

2

Solved

I am trying to create a table view with pagination, sorting, and filtering, using the most common/standard/recommended approach for Django 1.6. This seems to be Generic Class-Based Views and django...

2

Solved

I use django-tables2 LinkColumn to create a column that call a function that allow the export of the object in the table. forms.py: class FilesTable(tables.Table): id = tables.LinkColumn('downl...
Dikmen asked 24/4, 2013 at 17:40

1

Solved

I have a working table generated by django-tables2: my_filter = TestFilter(request.POST) table = TestTable(TestObj.objects.all(), order_by="-my_date") RequestConfig(request, paginate={"per_page":...
Royster asked 2/1, 2014 at 15:37

© 2022 - 2024 — McMap. All rights reserved.