Widgets Reference

Widgets are report elements to show text values on report canvas.

All widget classes can be initialized with their attributes as class arguments.

Widget

Path: geraldo.widgets.Widget

Base class for reports widgets, you should use it only to inherit and make your own widgets, otherwise you shouldn't use it directly.

Attributes

Rendering attributes

They are read-only attributes you can use in render time.

Label

Path: geraldo.Label

A label is just a simple text.

Example of use

>>> Label(text='Taxes we have paid', left=1*cm, top=0.5*cm, width=10*cm, height=0.5*cm)

Attributes

get_value must have 'text' argument.

ObjectValue

Path: geraldo.ObjectValue

This shows the value from a method, field or property from objects got from the queryset.

You can inform an action to show the object value or an aggregation function on it.

You can also use 'display_format' attribute to set a friendly string formating, with a mask or additional text.

'get_value' lambda must have 'instance' argument.

Example of use

>>> ObjectValue(attribute_name='name', left=1*cm, top=0.5*cm, width=10*cm, height=0.5*cm)

Attributes

SystemField

This shows system informations, like the report title, current date/time, page number, pages count, etc.

'get_value' must have 'expression' and 'fields' argument.

Example of use

>>> ObjectValue(expression='%(report_title)s', left=1*cm, top=0.5*cm, width=10*cm, height=0.5*cm)

Attributes