Hi everyone
Firstly, as others have said, very excited about the possibility that offline cache usage provides. However, it seems to have a problem with images:
This used to work fine, when I downloaded each row of a data table, one column of which holds images, as a list of dictionaries, first converting each row to a dictionary with dict(). This list was stored to a local global variable - any image component could load the ‘pic’ key-value from the local variable (list of dictionaries) no problem.
Now trying the cache, at first use, I load the data table to local in exactly the same way, list of dicts, each row converted to a dict with dict(), then save into the cache.
On load, the app looks for the cache, and if it’s available it loads the list of dictionaries to the same global variable, but now trying to access an image throws:
TypeError: The ‘source’ property can only be set to a Media object or a URL
…at this line:
i = Image(source=self.item[‘pic’],height=50,width=50)
when printing the self.item[‘pic’] I get this:
{‘v’: {’$d’: {‘size’: 0, ‘entries’: {}, ‘buckets’: {}, ‘in$repr’: False, ‘$version’: 0}, ‘$anvil_isLazyMedia’: True, ‘_spec’: {‘manager’: ‘table-media’, ‘key’: ‘bf7bb5ef4fe37edbd2817a0b2d476f6c’, ‘id’: ‘13866864’, ‘mime-type’: ‘image/jpeg’, ‘length’: None, ‘name’: ‘Baby Einstein Light and Rock Guitar.jpg’, ‘type’: [‘LazyMedia’], ‘path’: [‘response’, 0, ‘pic’]}}, ‘$isPyWrapped’: True}
Is there a special way I must handle media between a data table and the cache?
Thanks in advance!
Bruce