Table Of Contents
DictAdapter¶
New in version 1.5.
Warning
This code is still experimental, and its API is subject to change in a future version.
DictAdapter is an adapter around a python dictionary of records. It extends the list-like capabilities of ListAdapter.
If you wish to have a bare-bones list adapter, without selection, use SimpleListAdapter.
- class kivy.adapters.dictadapter.DictAdapter(**kwargs)¶
Bases: kivy.adapters.listadapter.ListAdapter
DictAdapter is an adapter around a python dictionary of records. It extends the list-like capabilities of ListAdapter.
- cut_to_sel(*args)¶
Same as trim_to_sel, but intervening list items within the selected range are cut also, leaving only list items that are selected.
sorted_keys will be updated by update_for_new_data().
- data¶
A dict that indexes records by keys that are equivalent to the keys in sorted_keys, or they are a superset of the keys in sorted_keys.
The values can be strings, class instances, dicts, etc.
data is a DictProperty, default to None.
- sorted_keys¶
The sorted_keys list property contains a list of hashable objects (can be strings) that will be used directly if no args_converter function is provided. If there is an args_converter, the record received from a lookup in the data, using key from sorted_keys, will be passed to it, for instantiation of list item view class instances.
sorted_keys is a ListProperty, default to [].
- trim_left_of_sel(*args)¶
Cut list items with indices in sorted_keys that are less than the index of the first selected item, if there is selection.
sorted_keys will be updated by update_for_new_data().
- trim_right_of_sel(*args)¶
Cut list items with indices in sorted_keys that are greater than the index of the last selected item, if there is selection.
sorted_keys will be updated by update_for_new_data().
- trim_to_sel(*args)¶
Cut list items with indices in sorted_keys that are les than or greater than the index of the last selected item, if there is selection. This preserves intervening list items within the selected range.
sorted_keys will be updated by update_for_new_data().