INNER CODE UNIT · Python
add
Zverik/every_door · tools/json_to_sqlite.py:67
def add(self, which: ReferenceStorage, value: Optional[str], name: str) -> None:
"""
We store the field/preset name in a list for the referenced field/preset.
When we read translations for *that* field/preset, we also add table
entries for this one.
"""
rname = self._get_reference(value)
if rname:
which[name] = rname
@staticmethod
def fetch(row: dict, field: str, data: dict[str, dict]) -> Optional[str]:
"""
Some values may reference other fields/presets instead of just stating a string.
That implies that translations are also referenced. For translations, we store
them in the ``add`` method, while here we just fetch the referenced value
from the same file, different field/preset.
"""