Skip to content

Instantly share code, notes, and snippets.

@veryhappythings
Created November 10, 2011 13:45
Show Gist options
  • Save veryhappythings/1354881 to your computer and use it in GitHub Desktop.
Save veryhappythings/1354881 to your computer and use it in GitHub Desktop.
class User(Base):
# ...
addresses = relationship(Address, lazy='dynamic')
class Address(Base):
contents = Column(String)
>>> jack.addresses
[<Address(u'[email protected]')>, <Address(u'[email protected]')>]
>>> jack.addresses.filter(Address.contents === u'[email protected]').all()
# Success!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment