File: multiple.html

package info (click to toggle)
django-tables 2.7.5-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,752 kB
  • sloc: python: 7,120; makefile: 132; sh: 74
file content (63 lines) | stat: -rw-r--r-- 2,443 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
{% extends "base.html" %}


{% block body %}
<h1><tt>django-tables2</tt> examples</h1>
<p>This page demonstrates various types of tables being rendered via
<tt>django-tables2</tt>.</p>

<h2>Example 1 — QuerySet</h2>
<h3>via <tt>as_html()</tt></h3>
<pre>{% templatetag openvariable %} example1.as_html {% templatetag closevariable %}</pre>
{{ example1.as_html }}

<h3>via template tag</h3>
<pre>{% templatetag openblock %} load django_tables2 {% templatetag closeblock %}
{% templatetag openblock %} render_table example1 {% templatetag closeblock %}</pre>
{% load django_tables2 %}
{% render_table example1 %}

<h2>Example 2 — QuerySet + pagination</h2>
<h3>via <tt>as_html()</tt></h3>
<pre>{% templatetag openvariable %} example2.as_html {% templatetag closevariable %}</pre>
{{ example2.as_html }}

<h3>via template tag</h3>
<pre>{% templatetag openblock %} load django_tables2 {% templatetag closeblock %}
{% templatetag openblock %} render_table example2 {% templatetag closeblock %}</pre>
{% load django_tables2 %}
{% render_table example2 %}

<h2>Example 3 — QuerySet + paleblue theme</h2>
<h3>via <tt>as_html()</tt></h3>
<pre>{% templatetag openvariable %} example3.as_html {% templatetag closevariable %}</pre>
{{ example3.as_html }}

<h3>via template tag</h3>
<pre>{% templatetag openblock %} load django_tables2 {% templatetag closeblock %}
{% templatetag openblock %} render_table example3 {% templatetag closeblock %}</pre>
{% load django_tables2 %}
{% render_table example3 %}

<h2>Example 4 — QuerySet + pagination + paleblue theme</h2>
<h3>via <tt>as_html()</tt></h3>
<pre>{% templatetag openvariable %} example4.as_html {% templatetag closevariable %}</pre>
{{ example4.as_html }}

<h3>via template tag</h3>
<pre>{% templatetag openblock %} load django_tables2 {% templatetag closeblock %}
{% templatetag openblock %} render_table example4 {% templatetag closeblock %}</pre>
{% load django_tables2 %}
{% render_table example4 %}

<h2>Example 5 – QuerySet + pagination + paleblue theme + custom template</h2>
<h3>via <tt>as_html()</tt></h3>
<pre>{% templatetag openvariable %} example5.as_html {% templatetag closevariable %}</pre>
{{ example5.as_html }}

<h3>via template tag</h3>
<pre>{% templatetag openblock %} load django_tables2 {% templatetag closeblock %}
{% templatetag openblock %} render_table example5 {% templatetag closeblock %}</pre>
{% load django_tables2 %}
{% render_table example5 %}
{% endblock %}