forked from platypush/platypush
Added children_ids
to the entity attributes serialized in to_json
.
This commit is contained in:
parent
de76c2b6a8
commit
ce248ccfbb
1 changed files with 8 additions and 5 deletions
|
@ -196,11 +196,14 @@ if 'entity' not in Base.metadata:
|
||||||
"""
|
"""
|
||||||
Returns the current entity as a flatten dictionary.
|
Returns the current entity as a flatten dictionary.
|
||||||
"""
|
"""
|
||||||
return dict(
|
return {
|
||||||
self._column_to_pair(col)
|
**dict(
|
||||||
for col in self.columns
|
self._column_to_pair(col)
|
||||||
if 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:
|
def to_json(self) -> dict:
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in a new issue