New in version 1.5.0.
An adapter is a mediating controller-type class that processes and presents
data for use in views. It does this by generating models, generally lists of
SelectableView items, that are consumed and
presented by views. Views are top-level widgets, such as a
ListView, that allow users to scroll through
and (optionally) interact with your data.
The role of an adapter can be depicted as follows:
The components involved in this process are:
Adapters: The adapter plays a mediating role between the user interface and your data. It manages the creation of the view elements for the model using the args_converter to prepare the contructor arguments for your cls/template view items.
Adapteris subclassed by the
DictAdapteris a more advanced and flexible subclass of
Models: The data for which an adapter serves as a bridge to views can be any sort of data. However, for convenience, model mixin classes can ease the preparation or shaping of data for use in the system. For selection operations, the
SelectableDataItemcan optionally prepare data items to provide and receive selection information (data items are not required to be “selection-aware”, but in some cases it may be desired).
Args Converters: Argument converters are made by the application programmer to do the work of converting data items to argument dictionaries suitable for instantiating views. In effect, they take each row of your data and create dictionaries that are passed into the constructors of your cls/template which are then used populate your View.
Views: Models of your data are presented to the user via views. Each of your data items create a corresponding view subitem (the cls or template) presented in a list by the View. The base
AbstractViewcurrently has one concrete implementation: the