Created
May 21, 2014 09:42
-
-
Save ThiefMaster/2fcf8f6cac73121481b8 to your computer and use it in GitHub Desktop.
This file contains 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
>>> 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> |
This file contains 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
# 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