docs: add comment regarding association proxy for dict(obj)
This commit is contained in:
parent
7734ee3b75
commit
fb1a7b22d8
1 changed files with 1 additions and 0 deletions
|
|
@ -56,6 +56,7 @@ class ModelBase: # pylint: disable=empty-docstring
|
||||||
|
|
||||||
def __iter__(self):
|
def __iter__(self):
|
||||||
# nb. we override this to allow for `dict(self)`
|
# nb. we override this to allow for `dict(self)`
|
||||||
|
# nb. this does *not* include association proxy values
|
||||||
state = sa.inspect(self)
|
state = sa.inspect(self)
|
||||||
fields = [attr.key for attr in state.attrs]
|
fields = [attr.key for attr in state.attrs]
|
||||||
return iter([(field, getattr(self, field)) for field in fields])
|
return iter([(field, getattr(self, field)) for field in fields])
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue