lino.utils.choosers

Extends the possibilities for defining choices for fields of a Django model.

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

Functions

action_chooser(**options)

chooser(**options)

Decorator which turns the method into a chooser.

noop(x)

uses_simple_values(holder, fld)

used by lino.core.store

Classes

BaseChooser

ChoicesChooser(field)

Chooser(model, field, meth)

A chooser holds information about the possible choices of a field.

FieldChooser(field)

class lino.utils.choosers.Chooser(model, field, meth)

Bases: lino.utils.choosers.FieldChooser

A chooser holds information about the possible choices of a field.

get_data_elem(name)

Calls dd.Actor.get_data_elem() or dd.Model.get_data_elem() or dd.Action.get_data_elem().

get_choices(**context)

Return a list of choices for this chooser, using keyword parameters as context.

get_request_choices(ar, tbl)

Return a list of choices for this chooser, using a HttpRequest to build the context.

lino.utils.choosers.uses_simple_values(holder, fld)

used by lino.core.store

lino.utils.choosers.chooser(**options)

Decorator which turns the method into a chooser.