Added `children_ids` to the entity attributes serialized in `to_json`.

This commit is contained in:
Fabio Manganiello 2023-05-01 19:59:13 +02:00
parent de76c2b6a8
commit ce248ccfbb
Signed by: blacklight
GPG Key ID: D90FBA7F76362774
1 changed files with 8 additions and 5 deletions

View File

@ -196,11 +196,14 @@ if 'entity' not in Base.metadata:
"""
Returns the current entity as a flatten dictionary.
"""
return dict(
self._column_to_pair(col)
for col in self.columns
if self._column_to_pair(col)
)
return {
**dict(
self._column_to_pair(col)
for col in self.columns
if self._column_to_pair(col)
),
'children_ids': [c.id for c in self.children],
}
def to_json(self) -> dict:
"""