lino.core.elems

Defines "layout elements" (widgets).

(This module's source code is available here.)

Functions

action_name(a)

add_help_text(kw, help_text, title, ...)

create_field_element(lh, field, **kw)

create_layout_element(lh, name, **kw)

Create a layout element from the named data element.

create_layout_panel(lh, name, vertical, ...)

This also must translate ui-agnostic parameters like label_align to their ExtJS equivalent labelAlign.

create_meth_element(lh, name, meth, rt, **kw)

create_vurt_element(lh, name, vf, **kw)

field2elem(layout_handle, field, **kw)

Create the appropriate layout element for the given database field.

form_field_name(f)

has_fk_renderer(fld)

is_hidden_babel_field(fld)

py2html(obj, name)

Classes

ActionParamsPanel(layout_handle, name, ...)

The optional Panel for parameters of an Action.

AutoFieldElement(layout_handle, field[, ...])

BooleanDisplayElement(*args, **kw)

BooleanFieldElement(layout_handle, field[, ...])

ButtonElement(lh, name, a, **kwargs)

Calendar([name])

CharFieldElement(*args, **kw)

ChoiceListFieldElement(layout_handle, field, ...)

Like ChoicesFieldElement, but we use the fact that choicelists are actors to define them once and refer to them.

ChoicesFieldElement(layout_handle, field[, ...])

ComboBox([name])

ComboFieldElement(layout_handle, field[, ...])

ComplexRemoteComboFieldElement(...[, hide_sum])

ConstantElement(lh, fld, **kw)

Container(layout_handle, name, *elements, **kw)

Base class for Layout Elements that can contain other Layout Elements: Panel, TabPanel, FormPanel, GridPanel

DateFieldElement(layout_handle, field[, ...])

DatePickerFieldElement(layout_handle, field)

DateTimeFieldElement(layout_handle, field, **kw)

DecimalFieldElement(*args, **kw)

DetailMainPanel(layout_handle, name, ...)

DisplayElement(*args, **kw)

ExtJS element to be used for DisplayFields.

ExtPanel([name])

FieldElement(layout_handle, field[, hide_sum])

Base class for all Widgets on some filed-like data element.

FileFieldElement(*args, **kw)

ForeignKeyElement(layout_handle, field[, ...])

GenericForeignKeyElement(layout_handle, ...)

A DisplayElement specially adapted to a GFK field.

GenericRelElement(layout_handle, field, **kw)

GridColumn(layout_handle, index, editor, **kw)

The component that generates the JS of a grid column.

GridElement(layout_handle, name, rpt, ...)

Represents a Lino.GridPanel, i.e. the widget used to represent a table or a slave table.

HtmlBoxElement(*args, **kw)

Element that renders to a Lino.HtmlBoxPanel.

IncompleteDateFieldElement(*args, **kw)

Widget for lino.core.fields.IncompleteDate fields.

IntegerFieldElement(layout_handle, field[, ...])

LayoutElement(layout_handle, name, **kw)

ManyRelatedObjectElement(lh, relobj, **kw)

ManyToManyElement(lh, relobj, **kw)

MonthFieldElement(layout_handle, field[, ...])

NumberFieldElement(layout_handle, field[, ...])

Base class for integers, decimals, RequestField,...

Panel(layout_handle, name, vertical, ...)

A vertical Panel is vflex if and only if at least one of its children is vflex.

ParamsPanel(layout_handle, name, vertical, ...)

The optional Panel for parameters of a Table.

PasswordFieldElement(*args, **kw)

QuantityFieldElement(*args, **kw)

ReactiveElement(lh, actor, **kw)

RecurrenceElement(*args, **kw)

RemoteComboFieldElement(layout_handle, field)

RequestFieldElement(layout_handle, field[, ...])

SimpleRemoteComboFieldElement(layout_handle, ...)

SingleRelatedObjectElement(lh, relobj, **kw)

The widget used to render a SingleRelatedObjectDescriptor, i.e. the other side of a OneToOneField.

SlaveSummaryPanel(lh, actor, **kw)

The panel used to display a slave table whose display_mode is 'summary'.

Spacer(layout_handle, name, **kw)

TabPanel(layout_handle, name, *elems, **kw)

TextFieldElement(layout_handle, field, **kw)

TimeFieldElement(layout_handle, field[, ...])

Toolbar([name])

URLFieldElement(*args, **kw)

Wrapper(e, **kw)

class lino.core.elems.GridColumn(layout_handle, index, editor, **kw)

Bases: lino.utils.jsgen.Component

The component that generates the JS of a grid column.

class lino.core.elems.FieldElement(layout_handle, field, hide_sum=False, **kw)

Bases: lino.core.elems.LayoutElement

Base class for all Widgets on some filed-like data element.

value_from_object(obj, ar)

Wrapper around Django's value_from_object. But for virtual fields it also forwards the action request ar.

value2html(ar, v, **cellattrs)

Return a <td> html etree element representing the given value.

The default implementation returns an HTML element obtained from format_value().

format_sum(ar, sums, i)

Return a string or an html element which expresses a sum of this column.

Ar

the action request

Sums

a list of sum values for all columns of this ar

I

the index of this field in sums

class lino.core.elems.ChoiceListFieldElement(layout_handle, field, **kw)

Bases: lino.core.elems.ChoicesFieldElement

Like ChoicesFieldElement, but we use the fact that choicelists are actors to define them once and refer to them. Special case are choicelist fields with blank=True: these must dynamicaly add a blank choice to the the choicelist.

class lino.core.elems.IncompleteDateFieldElement(*args, **kw)

Bases: lino.core.elems.CharFieldElement

Widget for lino.core.fields.IncompleteDate fields.

class lino.core.elems.NumberFieldElement(layout_handle, field, hide_sum=False, **kw)

Bases: lino.core.elems.FieldElement

Base class for integers, decimals, RequestField,...

class lino.core.elems.DisplayElement(*args, **kw)

Bases: lino.core.elems.FieldElement

ExtJS element to be used for DisplayFields.

class lino.core.elems.SingleRelatedObjectElement(lh, relobj, **kw)

Bases: lino.core.elems.DisplayElement

The widget used to render a SingleRelatedObjectDescriptor, i.e. the other side of a OneToOneField.

class lino.core.elems.GenericForeignKeyElement(layout_handle, field, **kw)

Bases: lino.core.elems.DisplayElement

A DisplayElement specially adapted to a GFK field.

class lino.core.elems.HtmlBoxElement(*args, **kw)

Bases: lino.core.elems.DisplayElement

Element that renders to a Lino.HtmlBoxPanel.

class lino.core.elems.SlaveSummaryPanel(lh, actor, **kw)

Bases: lino.core.elems.HtmlBoxElement

The panel used to display a slave table whose display_mode is 'summary'.

Note that this creates an automatic VirtualField which is a bit special because it is created during create_layout_element() after the startup analysis.

class lino.core.elems.Wrapper(e, **kw)

Bases: lino.utils.jsgen.VisibleComponent

class lino.core.elems.Container(layout_handle, name, *elements, **kw)

Bases: lino.core.elems.LayoutElement

Base class for Layout Elements that can contain other Layout Elements: Panel, TabPanel, FormPanel, GridPanel

get_view_permission(user_type)

A Panel which doesn't contain a single visible element becomes itself hidden.

class lino.core.elems.Panel(layout_handle, name, vertical, *elements, **kw)

Bases: lino.core.elems.Container

A vertical Panel is vflex if and only if at least one of its children is vflex. A horizontal Panel is vflex if and only if all its children are vflex (if vflex and non-vflex elements are together in a hbox, then the vflex elements will get the height of the highest non-vflex element).

class lino.core.elems.GridElement(layout_handle, name, rpt, *columns, **kw)

Bases: lino.core.elems.Container

Represents a Lino.GridPanel, i.e. the widget used to represent a table or a slave table.

class lino.core.elems.ParamsPanel(layout_handle, name, vertical, *elements, **kw)

Bases: lino.core.elems.Panel

The optional Panel for parameters of a Table. JS part stored in Lino.GridPanel.params_panel.

class lino.core.elems.ActionParamsPanel(layout_handle, name, vertical, *elements, **kw)

Bases: lino.core.elems.Panel

The optional Panel for parameters of an Action.

lino.core.elems.field2elem(layout_handle, field, **kw)

Create the appropriate layout element for the given database field.

lino.core.elems.create_layout_panel(lh, name, vertical, elems, **kwargs)

This also must translate ui-agnostic parameters like label_align to their ExtJS equivalent labelAlign.

lino.core.elems.create_layout_element(lh, name, **kw)

Create a layout element from the named data element.