• Stars
    star
    1,850
  • Rank 25,066 (Top 0.5 %)
  • Language
    Python
  • License
    Other
  • Created almost 14 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

django-tables2 - An app for creating HTML tables

django-tables2 - An app for creating HTML tables

Latest PyPI version Any color you like

django-tables2 simplifies the task of turning sets of data into HTML tables. It has native support for pagination and sorting. It does for HTML tables what django.forms does for HTML forms. e.g.

Features:

  • 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.

An example table rendered using django-tables2

An example table rendered using django-tables2 and bootstrap theme

An example table rendered using django-tables2 and semantic-ui theme

Example

Start by adding django_tables2 to your INSTALLED_APPS setting like this:

INSTALLED_APPS = (
    ...,
    "django_tables2",
)

Creating a table for a model Simple is as simple as:

import django_tables2 as tables

class SimpleTable(tables.Table):
    class Meta:
        model = Simple

This would then be used in a view:

class TableView(tables.SingleTableView):
    table_class = SimpleTable
    queryset = Simple.objects.all()
    template_name = "simple_list.html"

And finally in the template:

{% load django_tables2 %}
{% render_table table %}

This example shows one of the simplest cases, but django-tables2 can do a lot more! Check out the documentation for more details.

More Repositories

1

Leaflet.Sync

Synchronized view of two maps.
JavaScript
235
star
2

Leaflet.encoded

Plugin to support Google's polyline encoding in Leaflet.
JavaScript
176
star
3

Leaflet-semicircle

Extend Leaflet's circle class to display semicircles.
JavaScript
120
star
4

leaflet-headless

Leaflet for node.
JavaScript
117
star
5

orc-data

Display/visualize some freely available ORC certificate sailboat data.
Svelte
72
star
6

python-lora

Decrypt LoRa payloads in python.
Python
67
star
7

leaflet.layerscontrol-minimap

Leaflet layers control with minimaps.
JavaScript
49
star
8

marinetraffic

Node module to use marinetraffic tracks.
JavaScript
26
star
9

leaflet-clonelayer

Clone leaflet layers
JavaScript
25
star
10

Leaflet.Grid

Displays a lat/lng grid overlay on Leaflet maps.
JavaScript
22
star
11

Leaflet.latlngcontrol

Show and edit the lat/lng for the center of a leaflet map
JavaScript
5
star
12

grunt-geojsonhint

Grunt task to run geojsonhint
JavaScript
3
star
13

chai-leaflet

Chai assertions to use with Leaflet map apps
JavaScript
3
star
14

fph-parser

Read Fisher & Paykel CPAP .FPH files.
Python
3
star
15

laser-gcode-swatch

Generate a series of paths at different feedrates / laser power, to check the effect of your CNC laser etcher on different materials.
JavaScript
3
star
16

f-engrave

Fork of f-engrave
Python
3
star
17

Compare-NewYork

Compare 1836 and modern New York
JavaScript
2
star
18

d3-legend

Simple legend for d3 using data-legend attributes on paths.
JavaScript
2
star
19

coconut-graph

Graph lib using d3
JavaScript
2
star
20

leaflet-layerscontrol-buttons

Leaflet layers control using a set of buttons.
CSS
2
star
21

saillogs

Stories about sailing in dutch.
JavaScript
2
star
22

rws2gpx

Rijkswaterstaat drijvende markeringen naar GPX converteren
HTML
2
star
23

svelte-django-gettext

Use Django's translation catalog in Svelte
JavaScript
2
star
24

NL-travel-advice

Travel advice from The Netherlands ministry of foreign affairs; JSON + map
JavaScript
1
star
25

NL-social-churches

Lijst van kerken in NL die actief zijn op social media met wat cijfertjes.
JavaScript
1
star