rewrite (data): Increase Column flexibility.

New Column field types.
Allow Column to be an attribute of a non-rowmodel.
Add `references` field to Column.
Add logging for registry attach.
Add support for alternative join types.
This commit is contained in:
2022-11-18 08:41:11 +02:00
parent e528e8d0b6
commit 56f66ec7d4
6 changed files with 50 additions and 12 deletions

View File

@@ -124,7 +124,7 @@ class RowModel:
# Cache to keep track of registered Rows
_cache_: Union[dict, WeakValueDictionary, WeakCache] = None # type: ignore
_key_: tuple[str, ...]
_key_: tuple[str, ...] = ()
_connector: Optional[Connector] = None
_registry: Optional[Registry] = None
@@ -145,7 +145,8 @@ class RowModel:
columns[key] = value
cls._columns_ = columns
cls._key_ = tuple(column.name for column in columns.values() if column.primary)
if not cls._key_:
cls._key_ = tuple(column.name for column in columns.values() if column.primary)
cls.table = RowTable(cls._tablename_, cls)
if cls._cache_ is None:
cls._cache_ = WeakValueDictionary()