Skip to content

Commit

Permalink
Merge pull request #32 from gheritarish/fix-README-relationship
Browse files Browse the repository at this point in the history
docs: Update README with instructions for relationship
  • Loading branch information
fschulze authored Sep 27, 2022
2 parents 1ff27e5 + cb87ae2 commit 868cfeb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ And an UML class diagram from a model:
from sqlalchemy.orm import class_mapper
# lets find all the mappers in our model
mappers = []
mappers = [model.__mapper__]
for attr in dir(model):
if attr[0] == '_': continue
try:
cls = getattr(model, attr)
mappers.append(class_mapper(cls))
mappers.append(cls.property.entity)
except:
pass
Expand Down

0 comments on commit 868cfeb

Please sign in to comment.