Welcome | Get started | Dive | Contribute | Topics | Reference | Changes | More
lino.utils.choosers¶
Extends the possibilities for defining choices for fields of a Django model.
Context-sensitive choices (see More about combo boxes)
Non-limiting choices (force_selection False) : specify a pick list of suggestions but leave the possibility to store manually entered values
Example values in Lino utilities.
Functions
|
|
|
|
|
Decorator which turns the method into a chooser. |
|
|
|
|
|
|
|
|
|
used by |
Classes
|
|
|
Converter for |
|
|
|
Holds information about the possible choices of a field. |
|
|
|
|
|
|
|
|
|
Converter for ForeignKey fields. |
|
Converter for GenericForeignKey fields. |
|
A Converter for ForeignKey and ManyToManyField. |
|
Converter for ManyToMany fields. |
- class lino.utils.choosers.LookupConverter(field, lookup_field)¶
Bases:
ConverterA Converter for ForeignKey and ManyToManyField. If the lookup_field is a BabelField, then it tries all available languages.
- class lino.utils.choosers.ChoiceConverter(field)¶
Bases:
ConverterConverter for
ChoiceListField.If you specify a string, then it can be a value or a name.
- class lino.utils.choosers.ForeignKeyConverter(field, lookup_field)¶
Bases:
LookupConverterConverter for ForeignKey fields.
- class lino.utils.choosers.GenericForeignKeyConverter(field)¶
Bases:
ConverterConverter for GenericForeignKey fields.
- class lino.utils.choosers.ManyToManyConverter(field, lookup_field)¶
Bases:
LookupConverterConverter for ManyToMany fields.
- class lino.utils.choosers.Chooser(model, field, meth)¶
Bases:
FieldChooserHolds information about the possible choices of a field.
- get_data_elem(name)¶
Calls
dd.Actor.get_data_elem()ordd.Model.get_data_elem()ordd.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.