Created
September 14, 2012 02:13
-
-
Save tell-k/3719402 to your computer and use it in GitHub Desktop.
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
| class Entry(Base): | |
| __tablename__ = 'entries' | |
| id = Column(Integer, primary_key=True) | |
| text = Column(String(200)) | |
| created_at = Column(DateTime, default=datetime.now, nullable=False) | |
| comments = relationship('Comment', backref="entry") | |
| class Comment(Base): | |
| __tablename__ = 'comments' | |
| id = Column(Integer, primary_key=True) | |
| entry_id = Column(Integer, ForeignKey('entries.id'), nullable=False) | |
| text = Column(String(200)) | |
| created_at = Column(DateTime, default=datetime.now, nullable=False) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment