Skip to content

Commit

Permalink
Support __json__ as fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
jace committed Aug 11, 2023
1 parent 9499827 commit 3dc32c0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/coaster/sqlalchemy/roles.py
Original file line number Diff line number Diff line change
Expand Up @@ -921,6 +921,9 @@ def __setitem__(self, key: str, value: str) -> None:
def __iter__(self) -> t.Iterator[str]:
yield from self._all_read

def __json__(self) -> t.Dict[str, t.Any]:
return dict(self)

def __eq__(self, other: t.Any) -> bool:
if other == self._obj:
return True
Expand Down

0 comments on commit 3dc32c0

Please sign in to comment.