Skip to content

Instantly share code, notes, and snippets.

@ThiefMaster
Created May 21, 2014 09:42
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ThiefMaster/2fcf8f6cac73121481b8 to your computer and use it in GitHub Desktop.
Save ThiefMaster/2fcf8f6cac73121481b8 to your computer and use it in GitHub Desktop.
>>> from indico.modules.rb.models import Photo
>>> Photo.room
AttributeError: type object 'Photo' has no attribute 'room'
>>> db.session.query(Photo)
<sqlalchemy.orm.query.Query at 0x8211490>
>>> Photo.room
<sqlalchemy.orm.attributes.InstrumentedAttribute at 0x81c8090>
# in the Room model
photo = relationship(
'Photo',
backref='room',
cascade='all, delete-orphan',
single_parent=True,
lazy=True
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment