Quote:
Originally Posted by rkworthy
This is an area that's unfamiliar for me. I can only find 3 files that reference the meta2 view and they don't seem to provide an interface to it. Could you point me in the right direction to learn more about this? Is db.get_metadata not the best way to retrieve metadata for a book?
|
These show up as an array reference because of how caching works.
Look at library.cache.py, and in particular refresh(), to see how the view is used to build the cache. You will see that it populates an array '_data'. There are some related pointer arrays that are used for sorting and searching.
Next look at library.database2, line 306 in current source. You see that the variable 'data' is assigned to the cache object. If data is subscripted (data[12]), because of python magic the ResultCache method __getitem__ is called, which will return the row from _data, thus the values returned by querying the meta2 view.
There are zillions of examples of using 'data' in caches.py and gui2.library.models.py. In particular, look at 'data' in models.py, where you will see how column names are translated to the cell in a line in data.