rewrite: Localisation support.
This commit is contained in:
@@ -23,6 +23,15 @@ class ModelData:
|
||||
# High level data cache to use, leave as None to disable cache.
|
||||
_cache = None # Map[id -> value]
|
||||
|
||||
@classmethod
|
||||
def _read_from_row(cls, parent_id, row, **kwargs):
|
||||
data = row[cls._column]
|
||||
|
||||
if cls._cache is not None:
|
||||
cls._cache[parent_id] = data
|
||||
|
||||
return data
|
||||
|
||||
@classmethod
|
||||
async def _reader(cls, parent_id, use_cache=True, **kwargs):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user