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 untrusted user: blacklight
GPG key ID: D90FBA7F76362774

View file

@ -196,11 +196,14 @@ if 'entity' not in Base.metadata:
"""
Returns the current entity as a flatten dictionary.
"""
return dict(
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:
"""