Last active
October 18, 2018 09:39
-
-
Save jordic/0f6a889236e09465a7a425abd8cc244c to your computer and use it in GitHub Desktop.
snippets sqlalchemy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ Some snippets I'm collecting throught sqlalchemy docs """ | |
| class User(Base): | |
| __tablename__ = 'user' | |
| id = Column(Integer, primary_key=True) | |
| def _get_addresses(self): | |
| return object_session(self).query(Address).with_parent(self).filter(...).all() | |
| addresses = property(_get_addresses) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment