Welcome | Get started | Dive | Contribute | Topics | Reference | Changes | More

lino.core.elems

Defines “layout elements” (widgets).

Functions

action_name(a)

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)

get_htmlbox_element(lh, de, name, **kw)

get_list_element(lh, de, name, **kw)

get_story_element(lh, de, name, **kw)

get_summary_element(lh, de, name, **kw)

has_fk_renderer(fld)

is_hidden_babel_field(fld)

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 field-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 render a table in grid mode.

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)

LightWeightContainer(lh, slave, name, ...)

Renders plain html usually generated by HtmlBox fields.

ListElement(lh, slave, 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)

PreviewTextFieldElement(layout_handle, ...)

QuantityFieldElement(*args, **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.

SlaveContainer(layout_handle, name, rpt, ...)

Container for a slave table in case it has width dependent layout

SlaveSummaryPanel(lh, slave, name, **kw)

The panel used to display a slave table when display_mode is DISPLAY_MODE_SUMMARY.

Spacer(layout_handle, name, **kw)

StoryElement(lh, slave, name, **kw)

The panel used to display objects as plain html generated by as_summary_row when display_mode is DISPLAY_MODE_STORY.

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: Component

The component that generates the JS of a grid column.

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

Bases: LayoutElement

Base class for all Widgets on some field-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: 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: CharFieldElement

Widget for lino.core.fields.IncompleteDate fields.

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

Bases: FieldElement

Base class for integers, decimals, RequestField,…

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

Bases: FieldElement

ExtJS element to be used for DisplayFields.

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

Bases: 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: DisplayElement

A DisplayElement specially adapted to a GFK field.

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

Bases: DisplayElement

Element that renders to a Lino.HtmlBoxPanel.

class lino.core.elems.LightWeightContainer(lh, slave, name, return_type, **kwargs)

Bases: HtmlBoxElement

Renders plain html usually generated by HtmlBox fields.

This creates an automatic VirtualField, which is special because it happens “dynamically” after the startup analysis, during create_layout_element().

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

Bases: LightWeightContainer

The panel used to display a slave table when display_mode is DISPLAY_MODE_SUMMARY.

class lino.core.elems.StoryElement(lh, slave, name, **kw)

Bases: LightWeightContainer

The panel used to display objects as plain html generated by as_summary_row when display_mode is DISPLAY_MODE_STORY.

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

Bases: 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: 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: Container

Represents a Lino.GridPanel, i.e. the widget used to render a table in grid mode.

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

Bases: GridElement

Container for a slave table in case it has width dependent layout

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

Bases: 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: 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.