File: ex_03_table_totals.py

package info (click to toggle)
sqlkit 0.9.5-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 8,184 kB
  • sloc: python: 17,477; sql: 166; makefile: 95; xml: 23; sh: 11
file content (22 lines) | stat: -rw-r--r-- 521 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
"""base/totals

A silly example to show the total on an integer.

Here images are rendered as icons as the argument to SqlTable is a model
class rather that a simple string. No reflection is done, the model is read
from file and the model has more info to explain how to display it as well.

"""

t = SqlTable(model.Movie,
             dbproxy=db,
             order_by='director_id',
             rows=30,
             geom=(800,600)
         )

t.totals.add_total('year')
t.totals.add_break('director_id')

t.reload()